On 25 July 2016, Yegappan Lakshmanan <[email protected]> wrote:
> Hi,
>
> On Mon, Jul 25, 2016 at 12:27 AM, LCD 47 <[email protected]> wrote:
> > On 24 July 2016, Yegappan Lakshmanan <[email protected]> wrote:
> >> I am attaching a patch to enhance the getqflist/getloclist()
> >> functions to return the title string and the
> >> setqflist()/setloclist() functions to set the title string.
> >>
> >> After this patch is incorporated, it will be easy to add the
> >> additional items (e.g. context, items, number, stack, etc.).
> >>
> >> The getqflist/setqflist functions now accept an optional dictionary
> >> parameter. The dictionary parameter specifies which items to get
> >> or set. If the {dict} argument is specified, then the getqflist
> >> function returns a dictionary.
> >
> > Why a dictionary (where values are ignored), rather than a list,
> > or a string of, say, comma-separated names? Or both?
> >
>
> This is to be consistent between the getqflist()/getloclist() and
> the setqflist()/setloclist() functions. In the setqflist() function,
> the value of a dictionary key specifies the value to set. In the
> getqflist() function, it specifies the value to return. For example,
> the following call sets the quickfix title:
>
> call setqflist([], 'a', {'title' : 'example'})
>
> The following call returns the quickfix title:
>
> call getqflist({'title' : 1})
The arguments of setqflist() are already different from those of
getqflist(), so why does an extra argument has to be the same? Why not
something like this:
call getqflist('title,context,nr')
or
call getqflist(['title', 'context', 'nr'])
vs.
call setqflist(errors, 'r',
\ { 'title': 'My preciousss', 'context': ctx, 'nr': -1 })
(BTW, { 'nr': -1 } could mean last).
/lcd
--
--
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.