Hi Nate,
On Sun, Sep 20, 2020 at 1:30 PM Nate Bosch <[email protected]>
wrote:
> The documentation for getloclist states:
>
> Returns an empty Dictionary if there is no location list for the window
> {nr} or the window is not present.
>
>
> https://github.com/vim/vim/blob/b816dae16dbeec91ccb6fd1c0289b86b4ad5d7b3/runtime/doc/eval.txt#L5478-L5479
>
The documentation needs to be updated. If the specified window is not
present, then returns an
empty dictionary. If the location list is not present, then returns default
values for all the items.
This is to be consistent with the quickfix stack which cannot be deleted
unlike the location list stack.
- Yegappan
> However there is either always an empty location list to start, or a
> non-empty dictionary is returned when there is no list.
>
> Reproduction steps:
>
> vim -u NONE
> :echo getloclist(1, {'all': 0})
>
> Expected: {}
>
> Actual: {'changedtick': 0, 'context': '', 'quickfixtextfunc': '',
> 'filewinid': 0, 'qfbufnr': 0, 'items': [], 'id': 0, 'nr': 0, 'winid': 0,
> 'idx': 0, 'title': '', 'size': 0}
>
> The same result if I add a location list and then call setloclist(1, [],
> 'f'), I expect that getloclist would then return an empty dictionary.
>
> Vim version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 20 2020
> 13:11:17) Included patches: 1-1718
>
>
>
--
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAAW7x7nekHU1rMT-GWbzxu1r-PGw3JvE8L_WpeRHma8P41o7OQ%40mail.gmail.com.