diff src/testdir/test_mksession.vim @ 28915:6c67aeb82b65 v8.2.4980

patch 8.2.4980: when 'shortmess' contains 'A' loading session may still warn Commit: https://github.com/vim/vim/commit/aaadb5b6f76ea03e5eb460121f3dbf46ad04ce50 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 18 22:07:47 2022 +0100 patch 8.2.4980: when 'shortmess' contains 'A' loading session may still warn 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 #10443)
author Bram Moolenaar <Bram@vim.org>
date Wed, 18 May 2022 23:15:02 +0200
parents 27dcbe70e1f0
children 699fbccbeab8
line wrap: on
line diff
--- a/src/testdir/test_mksession.vim
+++ b/src/testdir/test_mksession.vim
@@ -1078,6 +1078,28 @@ 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('%')
+  let cont = readblob(fname)
+  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()
   mksession! Xtest_mks1.out