Closed sainnhe closed 2 years ago
This is by design, it seems that vim's buffer is not associated with tab. So tabOnly
is designed using tabpagebuflist()
function.
Or do you have any suggestions for improvement?
IMO, it's possible to maintain a dictionary variable that contains all the tabs to which a buffer belongs.
For example, create an autocmd triggered by BufAdd
event which will update a t:var
. This t:var
is a dictionary, the key is bufnum, and the value is a list that contains all tabs this buffer belongs to.
It seems pretty good, I can maintain an array of tabs in my buffer object to do buffer filtering
Thanks! It works now. But there seems to be a bug in buffer.tabOnly mode:
If you set "explorer.buffer.tabOnly": true,
in coc-settings.json and use nvim to open a file $ nvim filename.txt
, the buffer section will be empty at the very beginning.
Thanks for the reply, it has been fixed in 0.21.2
Thank you! I can confirm that this has been fixed now.
Describe the bug
When "explorer.buffer.tabOnly" is set to true, the buffer section should show all buffers in current tab, but in fact only the currently opened buffer will be shown.
Minimal vimrc
mini.vim:
coc-settings.json:
Steps to reproduce this bug
file1
andfile2
);nvim -u /path/to/mini.vim file1
;:CocCommand explorer
;file1
is shown here;o
to open another filefile2
;file2
is shown in buffer section.Expected behavior
Both
file1
andfile2
should be shown in buffer section.