mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.0.0300: cannot stop diffing hidden buffers
Problem: Cannot stop diffing hidden buffers. (Daniel Hahler) Solution: When using :diffoff! make the whole list if diffed buffers empty. (closes #736)
This commit is contained in:
@@ -212,6 +212,7 @@ func Test_diffoff()
|
||||
call setline(1, ['One', '', 'Two', 'Three'])
|
||||
diffthis
|
||||
redraw
|
||||
call assert_notequal(normattr, screenattr(1, 1))
|
||||
diffoff!
|
||||
redraw
|
||||
call assert_equal(normattr, screenattr(1, 1))
|
||||
@@ -219,6 +220,42 @@ func Test_diffoff()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_diffoff_hidden()
|
||||
set diffopt=filler,foldcolumn:0
|
||||
e! one
|
||||
call setline(1, ['Two', 'Three'])
|
||||
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
|
||||
" diffing with hidden buffer two
|
||||
call assert_notequal(normattr, screenattr(1, 1))
|
||||
diffoff
|
||||
redraw
|
||||
call assert_equal(normattr, screenattr(1, 1))
|
||||
diffthis
|
||||
redraw
|
||||
" still diffing with hidden buffer two
|
||||
call assert_notequal(normattr, screenattr(1, 1))
|
||||
diffoff!
|
||||
redraw
|
||||
call assert_equal(normattr, screenattr(1, 1))
|
||||
diffthis
|
||||
redraw
|
||||
" no longer diffing with hidden buffer two
|
||||
call assert_equal(normattr, screenattr(1, 1))
|
||||
|
||||
bwipe!
|
||||
bwipe!
|
||||
set hidden& diffopt&
|
||||
endfunc
|
||||
|
||||
func Test_setting_cursor()
|
||||
new Xtest1
|
||||
put =range(1,90)
|
||||
|
Reference in New Issue
Block a user