John Beckett wrote:

> I'm trying to cleanup an interesting tip that automatically
> manipulates the quickfix list with a QuickfixCmdPost event.
> The tip sorts the list by file name and line number and omits
> duplicates:
> http://vim.wikia.com/wiki/Automatically_sort_Quickfix_list
> 
> A custom sort function compares two items in the quickfix list
> and the following code is used to determine whether the two
> quickfix items have the same buffer name:
> 
>   if bufname(a:i1.bufnr) == bufname(a:i2.bufnr)
> 
> The argument a:i1 is a quickfix item; it is a dictionary and
> bufnr is a field that specifies the number of the buffer
> associated with the quickfix item. See ':help getqflist()'.
> 
> Is the following line equivalent to the code above?
> 
>   if a:i1.bufnr == a:i2.bufnr
> 
> I do not see how two different buffers could have the same
> bufname(), so just checking the buffer number seems sufficient.
> I concede that this is probably not worth worrying about, it's
> just my curiosity and wondering what I'm missing.

The empty name can appear on several buffers.

-- 
hundred-and-one symptoms of being an internet addict:
35. Your husband tells you he's had the beard for 2 months.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to