mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(shada): prevent 'nobuflisted' buffers in v:oldfiles #34373
Problem: 'nobuflisted' buffers are incorrectly added to v:oldfiles. Solution: Use ignore_buf() consistently in shada_write() for buffer marks processing.
This commit is contained in:
@ -91,4 +91,18 @@ describe('shada support code', function()
|
||||
eq('', fn.bufname(1))
|
||||
eq(testfilename, fn.bufname(2))
|
||||
end)
|
||||
|
||||
it("does not add 'nobuflisted' buffers to v:oldfiles", function()
|
||||
reset("set shada='100")
|
||||
nvim_command('edit ' .. testfilename)
|
||||
nvim_command('setlocal nobuflisted')
|
||||
nvim_command('edit ' .. testfilename_2)
|
||||
nvim_command('setlocal buflisted')
|
||||
nvim_command('write')
|
||||
expect_exit(nvim_command, 'qall')
|
||||
reset("set shada='100")
|
||||
local oldfiles = api.nvim_get_vvar('oldfiles')
|
||||
eq(1, #oldfiles)
|
||||
t.matches(vim.pesc(testfilename_2), oldfiles[1])
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user