You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] The bufferline sometimes cannot work well with offsets #798
When I open the neovim by directory, there is a line like this, even though I have set options.offset.test = "File Explorer"
And it will disappear when I move my cursor by mouse or keyboard
@nullptr-yxw please don't open multiple issues if they aren't very clearly indicated why each is different. I'm only one person maintaining this repo with lots of new issues all the time it just makes things harder. Please just detail precisely the problem on this one issue and if possible look at the code to consider helping raise a PR as well 🙏🏾
@nullptr-yxw please don't open multiple issues if they aren't very clearly indicated why each is different. I'm only one person maintaining this repo with lots of new issues all the time it just makes things harder. Please just detail precisely the problem on this one issue and if possible look at the code to consider helping raise a PR as well 🙏🏾
@akinsho Ok, I have change this issue to describe the two problem in one issue
@nullptr-yxw there is some confusion about this feature. Offsets are only relevant when there is more than one window open. When you open neovim in a directory and it is the only window open offsets do not apply, they never have that is not why they were designed.
This can be added if you want to contribute it but is not the use case I designed them for.
Regarding the naming of the offset that should work consistently and does for me but as I have mentioned offsets are not designed to apply when there is only one window open.
When there is only one window open, there is no offset at all because nothing is being offset.
Offsets are not a perfect solution without issue because offsets are a bit of a hack around native neovim behaviour. They do not cover all use cases and when I added the feature I explained that I was not going to sink hours of my time into fixing every edge case. The main use case for offsets is right or left aligned side bar that is open beside another window.
@nullptr-yxw there is some confusion about this feature. Offsets are only relevant when there is more than one window open. When you open neovim in a directory and it is the only window open offsets do not apply, they never have that is not why they were designed.
This can be added if you want to contribute it but is not the use case I designed them for. Regarding the naming of the offset that should work consistently and does for me but as I have mentioned offsets are not designed to apply when there is only one window open.
When there is only one window open, there is no offset at all because nothing is being offset. Offsets are not a perfect solution without issue because offsets are a bit of a hack around native neovim behaviour. They do not cover all use cases and when I added the feature I explained that I was not going to sink hours of my time into fixing every edge case. The main use case for offsets is right or left aligned side bar that is open beside another window.
But what about the second problem? I only closed the main.cpp, and the functor.cpp still exists, but the behavior is not normal as well
@nullptr-yxw the issue you are seeing is because bufferline uses the the native mechanism to close buffers in neovim :bdelete this command does not preserve your windows and is a well known and often discussed issue in the (n)vim ecosystem. There is a config option to replace that default command with some command of your own liking please read the README for how to configure the close action. Then use some plugin like nvim-bufdel or bufdelete.nvim etc. there are loads of options for that
@nullptr-yxw the issue you are seeing is because bufferline uses the the native mechanism to close buffers in neovim :bdelete this command does not preserve your windows and is a well known and often discussed issue in the (n)vim ecosystem. There is a config option to replace that default command with some command of your own liking please read the README for how to configure the close action. Then use some plugin like nvim-bufdel or bufdelete.nvim etc. there are loads of options for that
Activity
akinsho commentedon Aug 2, 2023
@nullptr-yxw please don't open multiple issues if they aren't very clearly indicated why each is different. I'm only one person maintaining this repo with lots of new issues all the time it just makes things harder. Please just detail precisely the problem on this one issue and if possible look at the code to consider helping raise a PR as well 🙏🏾
nullptr-yxw commentedon Aug 2, 2023
@akinsho Ok, I have change this issue to describe the two problem in one issue
akinsho commentedon Aug 2, 2023
@nullptr-yxw there is some confusion about this feature. Offsets are only relevant when there is more than one window open. When you open neovim in a directory and it is the only window open offsets do not apply, they never have that is not why they were designed.
This can be added if you want to contribute it but is not the use case I designed them for.
Regarding the naming of the offset that should work consistently and does for me but as I have mentioned offsets are not designed to apply when there is only one window open.
When there is only one window open, there is no offset at all because nothing is being offset.
Offsets are not a perfect solution without issue because offsets are a bit of a hack around native neovim behaviour. They do not cover all use cases and when I added the feature I explained that I was not going to sink hours of my time into fixing every edge case. The main use case for offsets is right or left aligned side bar that is open beside another window.
nullptr-yxw commentedon Aug 2, 2023
But what about the second problem? I only closed the main.cpp, and the functor.cpp still exists, but the behavior is not normal as well
akinsho commentedon Aug 2, 2023
@nullptr-yxw the issue you are seeing is because bufferline uses the the native mechanism to close buffers in neovim
:bdeletethis command does not preserve your windows and is a well known and often discussed issue in the (n)vim ecosystem. There is a config option to replace that default command with some command of your own liking please read the README for how to configure the close action. Then use some plugin likenvim-bufdelorbufdelete.nvimetc. there are loads of options for thatnullptr-yxw commentedon Aug 2, 2023
Thanks for your answer and advice very much.
akinsho commentedon Aug 3, 2023
The first issue might end up being fixed by #800 but in either case closing this out