Yegappan Lakshmanan wrote:
> On Fri, Sep 16, 2016 at 11:32 PM, LCD 47 <[email protected]> wrote:
> > On 16 September 2016, Yegappan Lakshmanan <[email protected]> wrote:
> >> Hi,
> >>
> >> On Sun, Sep 11, 2016 at 4:08 AM, LCD 47 <[email protected]> wrote:
> >> > On 12 August 2016, Bram Moolenaar <[email protected]> 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.
--
ARTHUR: Well, it doesn't matter. Will you go and tell your master that
Arthur from the Court of Camelot is here.
GUARD #1: Listen, in order to maintain air-speed velocity, a swallow
needs to beat its wings 43 times every second, right?
ARTHUR: Please!
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.