ap / vim-buftabline

Forget Vim tabs – now you can have buffer tabs
http://www.vim.org/scripts/script.php?script_id=5057
MIT License
791 stars 72 forks source link

Tabline sometimes disappears when closing location list #39

Closed deathlyfrantic closed 6 years ago

deathlyfrantic commented 6 years ago

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:

bug

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 and lclose). 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.

ap commented 6 years ago

At the point where you :call buftabline#update(0), can you :set tabline? showtabline? instead, and post its output?

deathlyfrantic commented 6 years ago
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 min.vim) and adjust as necessary:

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 nvim -u NONE -c "source min.vim". Your cursor should end up in the 456.txt buffer, and if you :lclose, the tabline should disappear along with the location list. Happens to me every time.

EDIT: Also appears to happen with regular Vim version 8.0.642.

ap commented 6 years ago

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.

deathlyfrantic commented 6 years ago

I finally figured this out! See #40. I don't think that change should break anything else, and it resolves this issue.

ap commented 6 years ago

Well thank you for doing all of the work. 😊