Open dlyongemallo opened 1 month ago
I also encounter this issue (Cursor position outside buffer
errors) when I mess with the windows while Trouble is open. Specifically if I close every window except the trouble window using <c-w>o
, and then press enter
to jump to the selected diagnostic.
If I set winfixbuf
in the Trouble window as suggested above, I instead see a single error Cannot switch buffer. 'winfixbuf' is enabled
.
If anyone else has the same problem, I worked around this by putting the following in my ~/.config/nvim/after/ftplugin/trouble.lua
:
vim.keymap.set('n', ']q', 'j', { buffer = 0, noremap = true, silent = true })
vim.keymap.set('n', '[q', 'k', { buffer = 0, noremap = true, silent = true })
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.10.0
Operating system/version
Ubuntu 22.04
Describe the bug
Trouble's special windows do not set winfixbuf. In particular, when in the qflist window, using
:cnext
or:cprev
results in aCursor position outside buffer
error (whereas neovim's owncopen
/cfile
window handles this perfectly fine).Steps To Reproduce
nvim -u repro.lua
:cfile cfile.txt
(attached cfile.txt):copen
, switch to this window:cnext
, works perfectly fine:Trouble qflist toggle
, switch to the Trouble window:cnext
, results in errorExpected Behavior
:cnext
and:cprev
should work as if in the nativecopen
window.Note: If
:set winfixbuf
is used inside the Trouble window, then:cnext
and:cprev
work as expected.Repro