aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_diffmode.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-11-16 16:13:51 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-11-16 16:40:25 -0500
commitb83027858af71e5ca976c3b43e0b798c624f5529 (patch)
treebeae2e17ceb60c68e7f421d6ccdd445063a55566 /src/nvim/testdir/test_diffmode.vim
parentda7bb53d995b409208b29a5fd5941075230f1504 (diff)
downloadrneovim-b83027858af71e5ca976c3b43e0b798c624f5529.tar.gz
rneovim-b83027858af71e5ca976c3b43e0b798c624f5529.tar.bz2
rneovim-b83027858af71e5ca976c3b43e0b798c624f5529.zip
vim-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. https://github.com/vim/vim/commit/c8234779790dd873acb88331c50988adf94cc383
Diffstat (limited to 'src/nvim/testdir/test_diffmode.vim')
-rw-r--r--src/nvim/testdir/test_diffmode.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim
index 57b19aa817..21e0271bda 100644
--- a/src/nvim/testdir/test_diffmode.vim
+++ b/src/nvim/testdir/test_diffmode.vim
@@ -773,3 +773,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