romgrk / barbar.nvim

The neovim tabline plugin.
2.17k stars 82 forks source link

fix: use `bufnr()` when loading session #474

Closed Iron-E closed 1 year ago

Iron-E commented 1 year ago
  1. When a session loads that has multiple working directories (i.e. :lcd/:tcd), buffers will always be named relative to the current working directory (i.e. the output of getcwd()). This means we have to save file paths relatively.
  2. bufadd doesn't seem to work like we thought. It always seems to add a new buffer first (regardless of whether it exists), and then return the new buffer on repeated calls.
    • The documentation states that if a buffer exists with a given name, it will return that buffer instead of creating it. But that seems to be only half true.

Closes #467

Iron-E commented 1 year ago

@otavioschwanck try this and let me know if it works

Nope, this isn't right. I'll ping you again when it is ready.

otavioschwanck commented 1 year ago

~@otavioschwanck try this and let me know if it works~

Nope, this isn't right. I'll ping you again when it is ready.

just waiting to test it!

Iron-E commented 1 year ago

@otavioschwanck alright, should be good to test now. If it isn't broken immediately, it would probably be best to test this for a working day just to make sure nothing is wrong.

Thanks for the help!

otavioschwanck commented 1 year ago

At first sight, it seems to be working.

EDIT: Did a 10 minutes test, pinning, unpinning, closing, opening neovim. Every time it saved / loaded correctly. If you want, you can merge this and keep the issue open, if in the next week no problem happens, i close the issue