Skip to content
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

Buffer name not updating #24

Open
chunkhang opened this issue Jul 11, 2019 · 3 comments
Open

Buffer name not updating #24

chunkhang opened this issue Jul 11, 2019 · 3 comments
Labels

Comments

@chunkhang
Copy link
Collaborator

Steps to reproduce:

  1. Launch Vim
  2. :split to create new window
  3. :edit file2 in that new window
  4. Switch back to first window
  5. :edit file1 in the first window

What was expected:
The tabline to be # | file1 | file2 |

What happened instead:
The tabline is # | * | file2 |

@bagrat bagrat added the bug label Jul 11, 2019
@bagrat
Copy link
Owner

bagrat commented Jul 11, 2019

This is probably related to the general caching mechanism (in a dict and array). I think we should rather reconsider how we keep the list of the existing buffers or just get the new list every time if the performance will allow to do so.

@chunkhang
Copy link
Collaborator Author

It seems like this line is the culprit.

" If this buffer is already tracked and listed, we're good.
" In case if it is the only buffer, still update, because an empty new
" buffer id is being replaced by a buffer for an existing file.
if is_present && len(s:buffers) > 1
  continue
endif

Currently, we're not updating the buffer if it already exists and there's more than 1 buffer. It works for most cases, but not when you perform the steps mentioned.

@tmerse
Copy link

tmerse commented Sep 22, 2019

I can confirm something similar happens, if I open a fila from nerdTree via the default "open in new tab"-binding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants