diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-07-12 01:37:04 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-07-17 16:12:49 +0100 |
commit | 96a6b9b52d93732fc39664e202470a65da6012b3 (patch) | |
tree | b725ee50694ce112696870d641065742dd2e870f /test | |
parent | 5377b2b00aea1a0bde1b81452e6198dabe5b9796 (diff) | |
download | rneovim-96a6b9b52d93732fc39664e202470a65da6012b3.tar.gz rneovim-96a6b9b52d93732fc39664e202470a65da6012b3.tar.bz2 rneovim-96a6b9b52d93732fc39664e202470a65da6012b3.zip |
vim-patch:8.1.0829: when 'hidden' is set session creates extra buffers
Problem: When 'hidden' is set session creates extra buffers.
Solution: Move :badd commands to the end. (Jason Franklin)
https://github.com/vim/vim/commit/d39e275b57493f9e25e1b62f84810571eee30cf4
Adjust some tests in ex_cmds/mksession_spec.lua:
- 'restores same :terminal buf in splits': Buffers aren't always :badded
in the same order as they're :edited, :balted, etc, so the order of
buffers in the buffer list may change slightly now that :badd happens
afterwards.
- 'restores buffers with tab-local CWD': This is explained in a comment.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ex_cmds/mksession_spec.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/functional/ex_cmds/mksession_spec.lua b/test/functional/ex_cmds/mksession_spec.lua index 949724bb53..09eaa36686 100644 --- a/test/functional/ex_cmds/mksession_spec.lua +++ b/test/functional/ex_cmds/mksession_spec.lua @@ -43,7 +43,7 @@ describe(':mksession', function() -- Restore session. command('source '..session_file) - eq({3,3,2}, + eq({2,2,4}, {funcs.winbufnr(1), funcs.winbufnr(2), funcs.winbufnr(3)}) end) @@ -91,7 +91,12 @@ describe(':mksession', function() 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')) + -- :mksession stores paths using unix slashes, but Nvim doesn't adjust these + -- for absolute paths in all cases yet. Absolute paths are used in the + -- session file after :tcd, so we need to expect unix slashes here for now + -- eq(cwd_dir .. get_pathsep() .. tmpfile_base .. '2', funcs.expand('%:p')) + eq(cwd_dir:gsub([[\]], '/') .. '/' .. tmpfile_base .. '2', + funcs.expand('%:p')) end) it('restores CWD for :terminal buffers #11288', function() |