Buffers and quickfix window help #3945
Unanswered
ristillu
asked this question in
Q&A - Ask for help with problems
Replies: 1 comment
-
In answer to my own question I could do something like this:
(thanks to stackoverflow, searching for things like "vim skip buffer") There are still a couple of quirks of behaviour if you have a single file buffer + a quickfix open but I can live with that. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been using ALE for a while and love it. Recently I've migrated to neovim and bufferline, although I suspect my issue is not exclusive to that. If I open two files that would cause ALE to trigger the quickfix buffer, that buffer seems to be the last valid buffer in my list, i.e.
:echo bufnr("$")
returns the buffer number for quickfix regardless of me never focusing on it. Here's a scenario:Two buffers are now open
Writing triggers ALE (i.e. I have
let g:ale_open_list = 'on_save'
set) and I get a quickfix window (actually location list but they have the same filetype and for all intents and purposes it's irrelevant)Now I have three buffers, with the quickfix window possibly unlisted if I have been playing with
set nobuflisted
. Regardless of if that setting is on or off it doesn't fix my problem. If I then do:to find the current buffer number I get 2, the buffer number for file2.py. If I do:
to find the previous buffer number it's 3, the index of the quickfix window. So if I now go to close the current buffer 2 associated with file2.py using
:bd
I would prefer (n)vim to jump to buffer 1, the previous valid file that I'm interested in. Instead my window becomes a full screen quickfix buffer. Interestingly if I do:echo bufnr("$")
it still says 3, as does:echo bufnr("%")
. Therefore both the previous and current buffers are the quickfix at that state. To get out of this state I have to do a second:bd
and it deletes buffer 3 and finally goes back to buffer 1.What I'd really like to have is the quickfix buffer displaying as a helper list down the bottom, as it does, but it and its status be ignored when I close the parent buffer. In the scenario I describe above I'd like to close file2.py's buffer and go back to file1.py and maybe or maybe not have the quickfix open (depending on the prior state of it in that buffer). That's just a wishlist item though, the memory of parent buffer + quickfix relationship status. My main gripe is having to buffer delete twice to close the buffer I'm looking at and get back to what I consider a valid buffer.
Beta Was this translation helpful? Give feedback.
All reactions