vim-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 vim/vim#2394)
97ce419201
This commit is contained in:
Jan Edmund Lazo
2018-08-11 14:55:02 -04:00
parent 90128843f6
commit 594536a1e7
4 changed files with 40 additions and 0 deletions

View File

@@ -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