You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vim -u DEFAULTS (version: 8.1, patches 1-2268) behaves the same.
Operating system/version: Arch Linux
Terminal name/version: termite v15
$TERM: xterm-termite
Steps to reproduce using nvim -u NONE
nvim -u NONE your-project
mistype something to populate qf list
:autocmd QuickFixCmdPost make call setqflist([], "a", {"nr": 2, "items": []})
:make
:cwindow
:chistory
Actual behaviour
After qf list is populated, the autocmd above creates another qf list at index 2. The initial qf list is still selected:
> error list 1 of 2; 13 errors :make
error list 2 of 2; 0 errors :setqflist()
Expected behaviour
After qf list is populated, the autocmd above should create another qf list at index 2 and set it as the selected. Like when I call setqflist manually after :make.
error list 1 of 2; 13 errors :make
> error list 2 of 2; 0 errors :setqflist()
The text was updated successfully, but these errors were encountered:
I am not sure whether this is intentional or not, but I think the behavior should be consistent both for autocmd and mapping/calling manually, unless the opposite is specified in the help. Also, here is the output of the following autocmd in vim 8.1:
> error list 1 of 1; 13 errors :make
[setqflist call]
error list 1 of 2; 13 errors :make
> error list 2 of 2; 0 errors :setqflist()
And when I type :chist again, it is already:
> error list 1 of 2; 13 errors :make`
error list 2 of 2; 0 errors :setqflist()
No mention about restrictions on setqflist() (like sandbox or textlock) in the help page (did I miss something?). Again, it works if I just type :call setqflist([], " ") or call it from mapping. By the way, setloclist() is also affected.
These caused UB in my plugin.
" create copy of the initial qf list to be able to restore it in the future
" produces list #2
call setqflist(getqflist(), " ")
" filter current list and apply it
" because vim set #2 as current list, "r" flag make vim to redraw qf window
call setqflist(filtered_items, "r")
When autocmd handler has finished, vim restore current qf list to #1 and completely breaks qf window. qf window contains items from list #2, but commands like :cnext operate on list #1. QuickFixLine syntax group is broken, too.
nvim --version
: NVIM v0.4.3vim -u DEFAULTS
(version: 8.1, patches 1-2268) behaves the same.$TERM
: xterm-termiteSteps to reproduce using
nvim -u NONE
Actual behaviour
After qf list is populated, the autocmd above creates another qf list at index 2. The initial qf list is still selected:
Expected behaviour
After qf list is populated, the autocmd above should create another qf list at index 2 and set it as the selected. Like when I call
setqflist
manually after:make
.The text was updated successfully, but these errors were encountered: