fix: buffer name not updated sometimes #167
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #160 where buf_name can be undefined ([no name] shown to the user)
under certain conditions.
Culrpit was commit 96a392b which removed events BufWinEnter,
BufWinLeave, BufDelete. This reintroduces these three events in autocmd
of win_name.
96a392b did not justify the change of events so I'm not confident of my commit. If you don't agree with this commit you can go ahead and edit it.
BTW at first I thought the bug was in lua/tabby/feature/buf_name.lua but this only defines the name of the buffer if you use the API
bufs
. The culprit is in win_name.lua because I use the API win.buf_name()I don't think buf_name.lua should be impacted by the bug because well <C-o>/<C-i> does not change the list of buffers it just changes the buffer inside a window. So only the window API is concerned by this.