Sometimes the popup window is unexpectedly closed when moving to the next or previous quickfix item with the keys specified in with next and previous options.
It seems to be caused by vim-cool and occurs when n or N are pressed right before the preview popup is opened. It happens only with the following vim-qf-preview settings:
let g:qfpreview = {'previous': 'p', 'next': 'n'}
but not with, for example:
let g:qfpreview = {'previous': "\<c-p>", 'next': "\<c-n>"}
To reproduce
- Add the following settings to your
vimrc:
let g:qfpreview = {'previous': 'p', 'next': 'n'}
augroup test
autocmd!
autocmd FileType qf nmap <Buffer> p <Plug>(qf-preview-open)
augroup END
- Run
vimgrep function $VIMRUNTIME/* or similar command to populate the quickfix list.
- Go to the quickfix window and press n or N to repeat the last
/ or ? pattern. It doesn't matter whether the next occurrence is found.
- Without moving the cursor press p to open the popup window.
- While the popup window is displayed move to the next or previous quickfix item with n or p, respectively.
- Result: vim-qf-preview moves the cursor properly to the next item but the popup window will close.
- Repeat step 3., but this time move the cursor with h/j/k/l before opening the popup window.
- Result: Moving to the next or previous quickfix item from the popup window works as expected.
Now use different keys for next and previous:
let g:qfpreview = {'previous': "\<c-p>", 'next': "\<c-n>"}
augroup test
autocmd!
autocmd FileType qf nmap <Buffer> p <Plug>(qf-preview-open)
augroup END
and repeat the above steps. Everything works as expected.
Sometimes the popup window is unexpectedly closed when moving to the next or previous quickfix item with the keys specified in with
nextandpreviousoptions.It seems to be caused by vim-cool and occurs when n or N are pressed right before the preview popup is opened. It happens only with the following vim-qf-preview settings:
but not with, for example:
To reproduce
vimrc:vimgrep function $VIMRUNTIME/*or similar command to populate the quickfix list./or?pattern. It doesn't matter whether the next occurrence is found.Now use different keys for
nextandprevious:and repeat the above steps. Everything works as expected.