diff src/testdir/test_diffmode.vim @ 27400:722db0819111 v8.2.4228

patch 8.2.4228: no tests for clicking in the GUI tabline Commit: https://github.com/vim/vim/commit/b0ad2d92fd19e673ddbbc66742bae3f71778efde Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Jan 27 13:16:59 2022 +0000 patch 8.2.4228: no tests for clicking in the GUI tabline Problem: No tests for clicking in the GUI tabline. Solution: Add test functions to generate the events. Add tests using the functions. (Yegappan Lakshmanan, closes #9638)
author Bram Moolenaar <Bram@vim.org>
date Thu, 27 Jan 2022 14:30:04 +0100
parents 391eb1c30344
children 95d6e3c9aa1e
line wrap: on
line diff
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -1464,4 +1464,50 @@ func Test_diff_binary()
   set diffopt&vim
 endfunc
 
+" Test for using the 'zi' command to invert 'foldenable' in diff windows (test
+" for the issue fixed by patch 6.2.317)
+func Test_diff_foldinvert()
+  %bw!
+  edit Xfile1
+  new Xfile2
+  new Xfile3
+  windo diffthis
+  " open a non-diff window
+  botright new
+  1wincmd w
+  call assert_true(getwinvar(1, '&foldenable'))
+  call assert_true(getwinvar(2, '&foldenable'))
+  call assert_true(getwinvar(3, '&foldenable'))
+  normal zi
+  call assert_false(getwinvar(1, '&foldenable'))
+  call assert_false(getwinvar(2, '&foldenable'))
+  call assert_false(getwinvar(3, '&foldenable'))
+  normal zi
+  call assert_true(getwinvar(1, '&foldenable'))
+  call assert_true(getwinvar(2, '&foldenable'))
+  call assert_true(getwinvar(3, '&foldenable'))
+
+  " If the current window has 'noscrollbind', then 'zi' should not change
+  " 'foldenable' in other windows.
+  1wincmd w
+  set noscrollbind
+  normal zi
+  call assert_false(getwinvar(1, '&foldenable'))
+  call assert_true(getwinvar(2, '&foldenable'))
+  call assert_true(getwinvar(3, '&foldenable'))
+
+  " 'zi' should not change the 'foldenable' for windows with 'noscrollbind'
+  1wincmd w
+  set scrollbind
+  normal zi
+  call setwinvar(2, '&scrollbind', v:false)
+  normal zi
+  call assert_false(getwinvar(1, '&foldenable'))
+  call assert_true(getwinvar(2, '&foldenable'))
+  call assert_false(getwinvar(3, '&foldenable'))
+
+  %bw!
+  set scrollbind&
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab