0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.1.2289: after :diffsplit closing the window does not disable diff

Problem:    After :diffsplit closing the window does not disable diff.
Solution:   Add "closeoff" to 'diffopt' and add it to the default.
This commit is contained in:
Bram Moolenaar
2019-11-10 21:00:27 +01:00
parent 5c6b6187ac
commit c823477979
7 changed files with 84 additions and 3 deletions

View File

@@ -964,3 +964,28 @@ func Test_diff_of_diff()
call StopVimInTerminal(buf)
call delete('Xtest_diff_diff')
endfunc
func CloseoffSetup()
enew
call setline(1, ['one', 'two', 'three'])
diffthis
new
call setline(1, ['one', 'tow', 'three'])
diffthis
call assert_equal(1, &diff)
only!
endfunc
func Test_diff_closeoff()
" "closeoff" included by default: last diff win gets 'diff' reset'
call CloseoffSetup()
call assert_equal(0, &diff)
enew!
" "closeoff" excluded: last diff win keeps 'diff' set'
set diffopt-=closeoff
call CloseoffSetup()
call assert_equal(1, &diff)
diffoff!
enew!
endfunc