-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer ordering not preserved neither in sessions nor with tabs #555
Comments
Possibly related: #31 |
Just checking :) Looking closer at this, I see there are a few things going on here. TabsI wasn't able to reproduce this one. I converted your snippet to run without lazy.nvim installed: local data_dir = vim.fn.stdpath 'data'
local plugin_dir = data_dir .. '/lazy/' -- or your plugin install path
vim.opt.rtp:prepend {
plugin_dir .. 'nvim-web-devicons',
plugin_dir .. 'gitsigns.nvim',
plugin_dir .. 'barbar.nvim',
}
vim.g.barbar_auto_setup = false
require('barbar').setup {
animation = true,
highlight_inactive_file_icons = false,
tabpages = true,
icons = {
buffer_number = true,
separator = { left = '', right = '▕' },
separator_at_end = true,
modified = { button = "" },
pinned = { button = "", filename = true, separator = { left = '', right = '▕'} },
},
} And reduced it to this: local data_dir = vim.fn.stdpath 'data'
local plugin_dir = data_dir .. '/lazy/'
vim.opt.rtp:prepend { plugin_dir .. 'barbar.nvim' }
vim.g.barbar_auto_setup = false
require('barbar').setup {
icons = {
filetype = { enabled = false },
},
} But I wasn't able to reproduce with either… if you do SessionsFirst, {
'folke/persistence.nvim',
event = "BufReadPre",
opts = { -- ← options go in `opts`
options = {--[[<other options>,]] 'globals'},
pre_save = function() vim.api.nvim_exec_autocmds('User', {pattern = 'SessionSavePre'}) end,
},
} The
Second, calling Alternatively, if you wish to use |
Sessions
That worked. I can now save sessions while preserving buffer order when running the user command I also updated my persistence.nvim settings with the clarifications you gave. Working fine now. TabsSorry my bad. Because I'm using multiple machines I accidentely pasted the wrong config file which was missing a plugin https://github.com/tiagovla/scope.nvim
For reference sake, here is my minimal.lua which reproduces the issue: local data_dir = vim.fn.stdpath 'data'
local plugin_dir = data_dir .. '/lazy/'
vim.opt.rtp:prepend { plugin_dir .. 'barbar.nvim' }
vim.g.barbar_auto_setup = false
require('barbar').setup {
icons = {
filetype = { enabled = false },
},
}
-- https://github.com/tiagovla/scope.nvim
vim.opt.rtp:prepend { plugin_dir .. 'scope.nvim' }
require("scope").setup({}) To reproduce:
Thanks for all the help. |
I'm glad
Not presently, but there is an effort to allow this in neovim/neovim#22814.
We have recommended this plugin in the past (#76), so it is in our best interest to maintain compatibility. I'll open a separate issue, since the problem with session restoration was resolved. |
Description
Buffer ordering not preserved on two different and independent cases.
When restoring a session the user's custom buffer ordering is lost.
When opening a new tab and moving back to the original the user's custom buffer ordering is lost.
Is there any way to prevent this automatic re-ordering?
Thanks
To Reproduce
lazyvim custom.lua
Steps to reproduce the behavior with tabs:
nvim aaa bbb ccc ddd eee
:tabe foo
Steps to reproduce the behavior with sessions:
nvim aaa bbb ccc ddd eee
:mksession ~/test-session.nvim
nvim -S ~/test-session.nvim
Informations
Running latest stable neovim and latest version of plugins updated today.
neovim v0.9.5
barbar 3c48b5e
lazyvim 0107a1079be7fb92f7d5b7e2c40818f47cf425d9
The text was updated successfully, but these errors were encountered: