romgrk / barbar.nvim

The neovim tabline plugin.
2.24k stars 83 forks source link

Barbar does not update when current file is renamed #319

Closed Bekaboo closed 1 year ago

Bekaboo commented 1 year ago

Description

I'm using rnvimr as my file manager in nvim. This plugin use RPC to communicate with Ranger and can inform nvim when the current file is removed or renamed by Ranger.

Recently I found that Barbar would not update after I rename the current file, while the statusline is aware of that and :echo expand(%:p) is also updated.

To Reproduce

Steps to reproduce the behavior:

  1. Use default config
  2. Install barbar.nvim and rnvimr
  3. Open a file
  4. Rename the file using rnvimr
  5. Check the name of current buffer displayed by Barbar and :echo expand(%:p)
  6. The name displayed by Barbar does not update until a new buffer is loaded

Maybe we can make Barbar update the information of current buffer more aggressively?

Screenshots

https://user-images.githubusercontent.com/76579810/196806603-9568c938-9bfa-4594-ba2c-68af25641215.mp4

Informations

Neovim version: 0.8.0

Iron-E commented 1 year ago

This might be a related to rnvimr specifically. I tried reproducing with nvim-tree and couldn't

Bekaboo commented 1 year ago

This might be a related to rnvimr specifically. I tried reproducing with nvim-tree and couldn't

Can we refresh Barbar at event BufEnter? Seems that currently barbar will refresh at BufAdd but not at BufEnter. If it will not be the default behavior, is it possible to realize it in the config for Barbar?

Iron-E commented 1 year ago

Sorry if that was a confusing comment. I just meant that as a note to self (or anyone looking) to check both repos' implementations to see what the difference was, and compensate for it