mirror of
https://github.com/neovim/neovim.git
synced 2026-09-04 13:20:34 +00:00
fix(editor): shada "force" load clears v:oldfiles #41662
Problem:
`shada_read()` rebuilds `v:oldfiles` for any "forced" read, which first
*clears* the list. For an in-memory caller such as multicursor, the list
is never repopulated. So `v:oldfiles` is empty after `Q` + edit.
Solution:
Rebuild `v:oldfiles` only when `kShaDaGetOldfiles` is requested.
`shada_read_everything()` (`:rshada[!]`, startup) always requests it.
old bug from 411a06c8b6
This commit is contained in:
@@ -2892,6 +2892,11 @@ describe('API', function()
|
||||
eq(1, eval('g:one'))
|
||||
eq('', eval('&shada'))
|
||||
eq(0, eval("get(g:, 'optionset', 0)"))
|
||||
|
||||
-- Does not touch v:oldfiles (only ":rshada!" rebuilds it).
|
||||
command('let v:oldfiles = ["/a", "/b"]')
|
||||
api.nvim_load_context(ctx)
|
||||
eq({ '/a', '/b' }, eval('v:oldfiles'))
|
||||
end)
|
||||
|
||||
it('errors when context dict is invalid', function()
|
||||
|
||||
Reference in New Issue
Block a user