diff src/testdir/test_diffmode.vim @ 12971:ca3cb1997f08 v8.0.1361

patch 8.0.1361: some users don't want to diff with hidden buffers commit https://github.com/vim/vim/commit/97ce419201421f65f4764549ed80307a7ef9c7a6 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 1 20:35:58 2017 +0100 patch 8.0.1361: some users don't want to diff with hidden buffers Problem: Some users don't want to diff with hidden buffers. Solution: Add the "hiddenoff" item to 'diffopt'. (Alisue, closes https://github.com/vim/vim/issues/2394)
author Christian Brabandt <cb@256bit.org>
date Fri, 01 Dec 2017 20:45:08 +0100
parents 1fad9675d8fd
children 195e8b1fcbbf
line wrap: on
line diff
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -375,6 +375,29 @@ func Test_diffopt_vertical()
   %bwipe
 endfunc
 
+func Test_diffopt_hiddenoff()
+  set diffopt=filler,foldcolumn:0,hiddenoff
+  e! one
+  call setline(1, ['Two', 'Three'])
+  redraw
+  let normattr = screenattr(1, 1)
+  diffthis
+  botright vert new two
+  call setline(1, ['One', 'Four'])
+  diffthis
+  redraw
+  call assert_notequal(normattr, screenattr(1, 1))
+  set hidden
+  close
+  redraw
+  " should not diffing with hidden buffer two while 'hiddenoff' is enabled
+  call assert_equal(normattr, screenattr(1, 1))
+
+  bwipe!
+  bwipe!
+  set hidden& diffopt&
+endfunc
+
 func Test_diffoff_hidden()
   set diffopt=filler,foldcolumn:0
   e! one