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

Issue when opening multiple files from a single command-line #3

Closed obxhdx closed 9 years ago

obxhdx commented 9 years ago

If you start Vim opening multiple files (e.g.: vim file1 file2), only the current buffer name displayed. It's like the plugin is not properly updated.

Not sure if that would be the ideal fix, but if I change BufAdd in buftabline.vim#L166 to be BufEnter, then it works fine.

ap commented 9 years ago

But if you do :enew after that, then thereafter everything works fine?

If so, can you try leaving line 166 as BufAdd but adding this line and tell me if that fixes the issue?

autocmd VimEnter * call buftabline#update(0)

(Changing it to BufEnter fixes the issue by triggering way more updates than necessary. I am trying to avoid that.)

obxhdx commented 9 years ago

It works after doing :enew, and adding an autocmd for VimEnter fixes the issue.

I understand your point about BufEnter,... it would call update everytime you switch buffers.

ap commented 9 years ago

Well it already does (otherwise it couldn’t render the change in active buffer!) but Vim already calls it automatically for that case – so forcing an update from an autocmd BufEnter would cause a double update at every buffer switch.