Hi Bram, On Tue, Sep 27, 2016 at 12:29 PM, Bram Moolenaar <b...@moolenaar.net> wrote: > > Yegappan Lakshmanan wrote: > >> On Fri, Sep 16, 2016 at 11:32 PM, LCD 47 <lcd...@gmail.com> wrote: >> > On 16 September 2016, Yegappan Lakshmanan <yegapp...@gmail.com> wrote: >> >> Hi, >> >> >> >> On Sun, Sep 11, 2016 at 4:08 AM, LCD 47 <lcd...@gmail.com> wrote: >> >> > On 12 August 2016, Bram Moolenaar <b...@moolenaar.net> wrote: >> >> >> >> >> >> Patch 7.4.2200 >> >> >> Problem: Cannot get all information about a quickfix list. >> >> >> Solution: Add an optional argument to get/set loc/qf list(). >> >> >> (Yegappan >> >> >> Lakshmanan) >> >> > >> >> > Another possible solution would be to track the current loclist >> >> > using the "nr" above, which is essentially the index of the current >> >> > loclist in the loclist stack. This is more problematic, as the >> >> > current interface is incomplete. It isn't possible to get the >> >> > current depth of the stack, and the only way to get the "nr" for >> >> > the current loclist is to query for "all" and ignore the irrelevant >> >> > fields in the result. >> >> > >> >> >> >> You can set the 'nr' key to -1 when calling the >> >> getqflist()/getloclist() function to use the current list. >> > >> > This doesn't seem to work, getloclist(0, {'nr': -1}) always seems >> > to return an error: >> > >> > :echo getloclist(0, {'all': 1}) >> > {'nr': 2, 'winid': 1001, 'title': ':SyntasticCheck gcc (c)'} >> > >> > :echo getloclist(0, {'nr': -1}) >> > {} >> > >> >> I am attaching a patch to return information about the current >> quickfix/location list, if the 'nr' field is set to zero. >> >> Without this change, to get the current quickfix/location list >> number, you need to set 'all' to 1, leave out 'nr' and then parse the >> returned information (as you suggested above). > > Thanks. I'll add a simple test, but perhaps you can test some more. >
The test looks good to me and I think this is sufficient to test this feature. Regards, Yegappan -- -- You received this message from the "vim_dev" 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 --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.