mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
shada: Save current cursor position before saving jumps
This commit is contained in:
parent
d8a97d7b79
commit
81ef9f55ae
@ -2591,9 +2591,12 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
|
||||
// Initialize jump list
|
||||
const void *jump_iter = NULL;
|
||||
do {
|
||||
xfmark_T fm;
|
||||
setpcmark();
|
||||
cleanup_jumplist();
|
||||
|
||||
xfmark_T fm;
|
||||
jump_iter = mark_jumplist_iter(jump_iter, curwin, &fm);
|
||||
|
||||
const buf_T *const buf = (fm.fmark.fnum == 0
|
||||
? NULL
|
||||
: buflist_findnr(fm.fmark.fnum));
|
||||
|
@ -153,6 +153,19 @@ describe('ShaDa support code', function()
|
||||
eq(saved, redir_exec('jumps'))
|
||||
end)
|
||||
|
||||
it('when dumping jump list also dumps current position', function()
|
||||
nvim_command('edit ' .. testfilename)
|
||||
nvim_command('normal! G')
|
||||
nvim_command('split ' .. testfilename_2)
|
||||
nvim_command('normal! G')
|
||||
nvim_command('wshada')
|
||||
nvim_command('quit')
|
||||
nvim_command('rshada')
|
||||
nvim_command('normal! \15') -- <C-o>
|
||||
eq(testfilename_2, funcs.bufname('%'))
|
||||
eq({2, 0}, curwinmeths.get_cursor())
|
||||
end)
|
||||
|
||||
it('is able to dump and restore jump list with different times (slow!)',
|
||||
function()
|
||||
nvim_command('edit ' .. testfilename_2)
|
||||
|
Loading…
Reference in New Issue
Block a user