-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabline sometimes disappears when closing location list #39
Comments
At the point where you |
tabline=%!buftabline#render()
showtabline=1 And FWIW, my buftabline settings: let g:buftabline_show = 1
let g:buftabline_indicators = 1
let g:buftabline_numbers = 2 I've finally nailed down a reliable way to reproduce this. Use this file (which I called set hidden
let g:buftabline_show = 1
let g:buftabline_indicators = 1
let g:buftabline_numbers = 2
source $HOME/.config/nvim/plugged/vim-buftabline/plugin/buftabline.vim
e 123.txt
w
e 456.txt
laddfile 123.txt
lopen
wincmd k Then EDIT: Also appears to happen with regular Vim version 8.0.642. |
Thank you for the effort! Much appreciated. I’ll take a look as soon as I have some time for it, and having a reliable reproduction makes that time a lot more likely to yield a fix. |
This should fix ap#39 - `lclose` can sometimes cause the tabline to disappear even when there are multiple buffers remaining. Essentially the problem is buftabline always assumes the buffer being deleted is the current buffer, which is generally true, but not always true. `bufnr('%')` gives us the number of the _current_ buffer which is not necessarily the buffer that is being added or deleted. `expand(<abuf>)` gives us the number of buffer on which the event is operating, but as a string - so we need to convert it to a number with `str2nr`. We can then determine if the actual buffer being deleted is a user buffer or not.
I finally figured this out! See #40. I don't think that change should break anything else, and it resolves this issue. |
Well thank you for doing all of the work. 😊 |
This is a really peculiar bug that only happens sometimes, and I'm not even sure buftabline is the responsible party. I have an autocmd set up to run Neomake on every BufWritePost. If there are errors, they get populated into the location list. If I correct the errors, save again, and Neomake finds no errors remaining, it will close the location list, which somehow makes the tabline disappear. Here's a terrible quality gif to demonstrate:
This is on Neovim 0.2.1 FWIW. I've tried all manner of ways to reproduce this and have yet to track down the root cause. I have been able to reproduce it without using Neomake (just by using
laddfile somefile.txt
,lopen
andlclose
). I've looked through buftabline's source and nothing has jumped out at me as being an obvious culprit, but I can't claim to fully understand everything it does. Mostly I'm just reporting it here as a first step, to see if you have any thoughts.The text was updated successfully, but these errors were encountered: