fix: store paths in g:BufferlinePositions#780
Merged
akinsho merged 3 commits intoakinsho:mainfrom Jun 28, 2023
Merged
Conversation
akinsho
reviewed
Jun 27, 2023
Owner
akinsho
left a comment
There was a problem hiding this comment.
@AThePeanut4 this change looks good to me generally. Haven't had time to test it myself but would be great to have a test to just confirm that this logic works.
It could be something as simple as setup bufferline in a test (see bufferline_spec.lua then open 3 files e.g. vim.cmd.edit('example-1.txt') etc. Then run save_positions then run restore_positions and check that the state is what you expect
Contributor
Author
|
Alright, I'll see what I can do. |
Contributor
Author
|
Alright I moved the functions to utils and added a test to |
Owner
|
Merged, thanks for taking this on @AThePeanut4 |
sstallion
pushed a commit
to sstallion/bufferline.nvim
that referenced
this pull request
Jul 3, 2024
This fixes an issue where restoring the custom sort order from a saved session doesn't work correctly most of the time, because it stores buffer ids in g:BufferlinePositions which are not preserved by :mksession. The fix is to store the full paths of the buffers instead. vim.json is required to stringify the list as :mksession only stores string/number values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This fixes an issue where restoring the custom sort order from a saved session doesn't work correctly most of the time, because it stores buffer ids in
g:BufferlinePositionswhich are not preserved by:mksession. The fix is to store the full paths of the buffers instead.vim.jsonis required to stringify the list as:mksessiononly stores string/number values.Split out from #777.