mirror of
https://github.com/neovim/neovim
synced 2025-07-17 17:51:48 +00:00
:mksession : restore tab-local working directories #9754
This commit is contained in:
committed by
Justin M. Keyes
parent
8698830cbd
commit
c5631338b1
@ -9130,6 +9130,7 @@ makeopens(
|
|||||||
|| put_eol(fd) == FAIL) {
|
|| put_eol(fd) == FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
did_lcd = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't continue in another tab page when doing only the current one
|
/* Don't continue in another tab page when doing only the current one
|
||||||
|
@ -47,4 +47,27 @@ describe(':mksession', function()
|
|||||||
command('tabnext 2')
|
command('tabnext 2')
|
||||||
eq(cwd_dir .. get_pathsep() .. tab_dir, funcs.getcwd())
|
eq(cwd_dir .. get_pathsep() .. tab_dir, funcs.getcwd())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('restores buffers when using tab-local working directories', function()
|
||||||
|
local tmpfile_base = file_prefix .. '-tmpfile'
|
||||||
|
local cwd_dir = funcs.getcwd()
|
||||||
|
local session_path = cwd_dir .. get_pathsep() .. session_file
|
||||||
|
|
||||||
|
command('edit ' .. tmpfile_base .. '1')
|
||||||
|
command('tcd ' .. tab_dir)
|
||||||
|
command('tabnew')
|
||||||
|
command('edit ' .. cwd_dir .. get_pathsep() .. tmpfile_base .. '2')
|
||||||
|
command('tabfirst')
|
||||||
|
command('mksession ' .. session_path)
|
||||||
|
|
||||||
|
-- Create a new test instance of Nvim.
|
||||||
|
clear()
|
||||||
|
|
||||||
|
-- Use :silent to avoid press-enter prompt due to long path
|
||||||
|
command('silent source ' .. session_path)
|
||||||
|
command('tabnext 1')
|
||||||
|
eq(cwd_dir .. get_pathsep() .. tmpfile_base .. '1', funcs.expand('%:p'))
|
||||||
|
command('tabnext 2')
|
||||||
|
eq(cwd_dir .. get_pathsep() .. tmpfile_base .. '2', funcs.expand('%:p'))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user