aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-20 07:20:38 +0800
committerGitHub <noreply@github.com>2022-05-20 07:20:38 +0800
commiteb0aa8bb0ebc3cc233af6a5281c553d14ee57183 (patch)
treef1cb3d29d60412ef8d8a4baf6d5e9dad844779d7 /src/nvim/testdir
parent69853a622a1fa9b920171657a255648e532bd444 (diff)
downloadrneovim-eb0aa8bb0ebc3cc233af6a5281c553d14ee57183.tar.gz
rneovim-eb0aa8bb0ebc3cc233af6a5281c553d14ee57183.tar.bz2
rneovim-eb0aa8bb0ebc3cc233af6a5281c553d14ee57183.zip
vim-patch:8.2.4980: when 'shortmess' contains 'A' loading session may still warn (#18636)
Problem: When 'shortmess' contains 'A' loading a session may still warn for an existing swap file. (Melker Österberg) Solution: Keep the 'A' flag to 'shortmess' in the session file. (closes vim/vim#10443) https://github.com/vim/vim/commit/aaadb5b6f76ea03e5eb460121f3dbf46ad04ce50 Use readfile() with "B" flag in test as readblob() needs patch 8.2.2343.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_mksession.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim
index 5dbe2cd366..c55ba391a5 100644
--- a/src/nvim/testdir/test_mksession.vim
+++ b/src/nvim/testdir/test_mksession.vim
@@ -838,6 +838,30 @@ func Test_mksession_shortmess()
set sessionoptions&
endfunc
+" Test that when Vim loading session has 'A' in 'shortmess' it does not
+" complain about an existing swapfile.
+func Test_mksession_shortmess_with_A()
+ edit Xtestfile
+ write
+ let fname = swapname('%')
+ " readblob() needs patch 8.2.2343
+ " let cont = readblob(fname)
+ let cont = readfile(fname, 'B')
+ set sessionoptions-=options
+ mksession Xtestsession
+ bwipe!
+
+ " Recreate the swap file to pretend the file is being edited
+ call writefile(cont, fname)
+ set shortmess+=A
+ source Xtestsession
+
+ set shortmess&
+ set sessionoptions&
+ call delete('Xtestsession')
+ call delete(fname)
+endfunc
+
" Test for mksession with 'compatible' option
func Test_mksession_compatible()
throw 'skipped: Nvim does not support "compatible" option'