summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_diffmode.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-16 13:50:25 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-16 13:50:25 +0100
commitf4a1d1c0542df151bc59ac3b798ed198b5c71ccc (patch)
tree9f6051c5c5e75c7f113a923f7888f0f272ddee9e /src/testdir/test_diffmode.vim
parentab85ca4e6a40b2998db7b00896505486f5c16b41 (diff)
patch 8.1.2302: :lockmarks does not work for '[ and ']v8.1.2302
Problem: :lockmarks does not work for '[ and ']. Solution: save and restore '[ and '] marks. (James McCoy, closes #5222)
Diffstat (limited to 'src/testdir/test_diffmode.vim')
-rw-r--r--src/testdir/test_diffmode.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index 6f4eaaf431..9dfe2fefce 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -989,3 +989,22 @@ func Test_diff_closeoff()
diffoff!
enew!
endfunc
+
+func Test_diff_maintains_change_mark()
+ enew!
+ call setline(1, ['a', 'b', 'c', 'd'])
+ diffthis
+ new
+ call setline(1, ['a', 'b', 'c', 'e'])
+ " Set '[ and '] marks
+ 2,3yank
+ call assert_equal([2, 3], [line("'["), line("']")])
+ " Verify they aren't affected by the implicit diff
+ diffthis
+ call assert_equal([2, 3], [line("'["), line("']")])
+ " Verify they aren't affected by an explicit diff
+ diffupdate
+ call assert_equal([2, 3], [line("'["), line("']")])
+ bwipe!
+ bwipe!
+endfunc