annotate src/testdir/test_diffmode.vim @ 12549:62e8cef76508 v8.0.1153

patch 8.0.1153: no tests for diff_hlID() and diff_filler() commit https://github.com/vim/vim/commit/97fbc404fc56f76df12b2d2658b1d6efda28d5dd Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 26 19:41:46 2017 +0200 patch 8.0.1153: no tests for diff_hlID() and diff_filler() Problem: No tests for diff_hlID() and diff_filler(). Solution: Add tests. (Dominique Pelle, closes https://github.com/vim/vim/issues/2156)
author Christian Brabandt <cb@256bit.org>
date Tue, 26 Sep 2017 19:45:04 +0200
parents 40ee9f3d265f
children 1fad9675d8fd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9694
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for diff mode
11091
ae45d497868f patch 8.0.0433: beeps when running tests
Christian Brabandt <cb@256bit.org>
parents: 11065
diff changeset
2 set belloff=all
9694
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 func Test_diff_fold_sync()
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 enew!
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 let l = range(50)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 call setline(1, l)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 diffthis
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 let winone = win_getid()
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 new
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 let l[25] = 'diff'
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 call setline(1, l)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 diffthis
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 let wintwo = win_getid()
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 " line 15 is inside the closed fold
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 call assert_equal(19, foldclosedend(10))
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 call win_gotoid(winone)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call assert_equal(19, foldclosedend(10))
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 " open the fold
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 normal zv
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call assert_equal(-1, foldclosedend(10))
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 " fold in other window must have opened too
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 call win_gotoid(wintwo)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal(-1, foldclosedend(10))
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 " cursor position is in sync
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 normal 23G
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call win_gotoid(winone)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call assert_equal(23, getcurpos()[1])
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 windo diffoff
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 close!
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 set nomodified
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 endfunc
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 func Test_vert_split()
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 " Disable the title to avoid xterm keeping the wrong one.
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 set notitle noicon
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 new
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 let l = ['1 aa', '2 bb', '3 cc', '4 dd', '5 ee']
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 call setline(1, l)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 w! Xtest
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 normal dd
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 $
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 put
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 normal kkrXoxxx
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 w! Xtest2
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 file Nop
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 normal ggoyyyjjjozzzz
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 set foldmethod=marker foldcolumn=4
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 call assert_equal(0, &diff)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 call assert_equal('marker', &foldmethod)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 call assert_equal(4, &foldcolumn)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 call assert_equal(0, &scrollbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 call assert_equal(0, &cursorbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 call assert_equal(1, &wrap)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 vert diffsplit Xtest
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 vert diffsplit Xtest2
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 call assert_equal(1, &diff)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 call assert_equal('diff', &foldmethod)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 call assert_equal(2, &foldcolumn)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 call assert_equal(1, &scrollbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 call assert_equal(1, &cursorbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 call assert_equal(0, &wrap)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 let diff_fdm = &fdm
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 let diff_fdc = &fdc
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 " repeat entering diff mode here to see if this saves the wrong settings
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 diffthis
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 " jump to second window for a moment to have filler line appear at start of
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 " first window
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 wincmd w
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 normal gg
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 wincmd p
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 normal gg
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 call assert_equal(2, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 call assert_equal(4, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 call assert_equal(5, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 call assert_equal(6, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 call assert_equal(8, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 call assert_equal(9, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 wincmd w
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 normal gg
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 call assert_equal(1, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 call assert_equal(2, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 call assert_equal(4, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 call assert_equal(5, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 call assert_equal(8, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 wincmd w
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 normal gg
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 call assert_equal(2, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 call assert_equal(3, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 call assert_equal(4, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 call assert_equal(5, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 call assert_equal(6, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113 call assert_equal(7, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 normal j
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 call assert_equal(8, winline())
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117 " Test diffoff
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118 diffoff!
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119 1wincmd 2
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 let &diff = 1
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 let &fdm = diff_fdm
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 let &fdc = diff_fdc
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123 4wincmd w
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 diffoff!
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 1wincmd w
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 call assert_equal(0, &diff)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127 call assert_equal('marker', &foldmethod)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128 call assert_equal(4, &foldcolumn)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129 call assert_equal(0, &scrollbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
130 call assert_equal(0, &cursorbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
131 call assert_equal(1, &wrap)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
132
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
133 wincmd w
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134 call assert_equal(0, &diff)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
135 call assert_equal('marker', &foldmethod)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
136 call assert_equal(4, &foldcolumn)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137 call assert_equal(0, &scrollbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
138 call assert_equal(0, &cursorbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
139 call assert_equal(1, &wrap)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
140
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
141 wincmd w
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
142 call assert_equal(0, &diff)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
143 call assert_equal('marker', &foldmethod)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
144 call assert_equal(4, &foldcolumn)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
145 call assert_equal(0, &scrollbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
146 call assert_equal(0, &cursorbind)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
147 call assert_equal(1, &wrap)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
148
9696
103e79a0ad8d commit https://github.com/vim/vim/commit/623cf88f9c5ad49cce8e846af29a1bb9346c7481
Christian Brabandt <cb@256bit.org>
parents: 9694
diff changeset
149 call delete('Xtest')
103e79a0ad8d commit https://github.com/vim/vim/commit/623cf88f9c5ad49cce8e846af29a1bb9346c7481
Christian Brabandt <cb@256bit.org>
parents: 9694
diff changeset
150 call delete('Xtest2')
9694
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
151 windo bw!
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
152 endfunc
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
153
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
154 func Test_filler_lines()
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
155 " Test that diffing shows correct filler lines
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
156 enew!
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
157 put =range(4,10)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
158 1d _
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
159 vnew
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
160 put =range(1,10)
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
161 1d _
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
162 windo diffthis
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
163 wincmd h
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
164 call assert_equal(1, line('w0'))
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
165 unlet! diff_fdm diff_fdc
9701
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
166 windo diffoff
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
167 bwipe!
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
168 enew!
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
169 endfunc
9694
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
170
9701
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
171 func Test_diffget_diffput()
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
172 enew!
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
173 let l = range(50)
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
174 call setline(1, l)
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
175 call assert_fails('diffget', 'E99:')
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
176 diffthis
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
177 call assert_fails('diffget', 'E100:')
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
178 new
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
179 let l[10] = 'one'
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
180 let l[20] = 'two'
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
181 let l[30] = 'three'
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
182 let l[40] = 'four'
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
183 call setline(1, l)
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
184 diffthis
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
185 call assert_equal('one', getline(11))
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
186 11diffget
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
187 call assert_equal('10', getline(11))
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
188 21diffput
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
189 wincmd w
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
190 call assert_equal('two', getline(21))
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
191 normal 31Gdo
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
192 call assert_equal('three', getline(31))
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
193 call assert_equal('40', getline(41))
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
194 normal 41Gdp
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
195 wincmd w
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
196 call assert_equal('40', getline(41))
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
197 new
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
198 diffthis
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
199 call assert_fails('diffget', 'E101:')
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
200
172855211978 commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents: 9696
diff changeset
201 windo diffoff
11430
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
202 %bwipe!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
203 endfunc
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
204
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
205 func Test_dp_do_buffer()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
206 e! one
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
207 let bn1=bufnr('%')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
208 let l = range(60)
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
209 call setline(1, l)
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
210 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
211
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
212 new two
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
213 let l[10] = 'one'
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
214 let l[20] = 'two'
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
215 let l[30] = 'three'
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
216 let l[40] = 'four'
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
217 let l[50] = 'five'
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
218 call setline(1, l)
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
219 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
220
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
221 " dp and do with invalid buffer number.
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
222 11
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
223 call assert_fails('norm 99999dp', 'E102:')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
224 call assert_fails('norm 99999do', 'E102:')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
225 call assert_fails('diffput non_existing_buffer', 'E94:')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
226 call assert_fails('diffget non_existing_buffer', 'E94:')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
227
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
228 " dp and do with valid buffer number.
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
229 call assert_equal('one', getline('.'))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
230 exe 'norm ' . bn1 . 'do'
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
231 call assert_equal('10', getline('.'))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
232 21
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
233 call assert_equal('two', getline('.'))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
234 diffget one
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
235 call assert_equal('20', getline('.'))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
236
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
237 31
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
238 exe 'norm ' . bn1 . 'dp'
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
239 41
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
240 diffput one
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
241 wincmd w
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
242 31
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
243 call assert_equal('three', getline('.'))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
244 41
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
245 call assert_equal('four', getline('.'))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
246
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
247 " dp and do with buffer number which is not in diff mode.
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
248 new not_in_diff_mode
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
249 let bn3=bufnr('%')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
250 wincmd w
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
251 51
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
252 call assert_fails('exe "norm" . bn3 . "dp"', 'E103:')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
253 call assert_fails('exe "norm" . bn3 . "do"', 'E103:')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
254 call assert_fails('diffput not_in_diff_mode', 'E94:')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
255 call assert_fails('diffget not_in_diff_mode', 'E94:')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
256
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
257 windo diffoff
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
258 %bwipe!
9694
5e9f63a2ac5c commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
259 endfunc
10005
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
260
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
261 func Test_diffoff()
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
262 enew!
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
263 call setline(1, ['Two', 'Three'])
11430
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
264 redraw
10005
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
265 let normattr = screenattr(1, 1)
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
266 diffthis
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
267 botright vert new
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
268 call setline(1, ['One', '', 'Two', 'Three'])
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
269 diffthis
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
270 redraw
10821
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
271 call assert_notequal(normattr, screenattr(1, 1))
10005
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
272 diffoff!
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
273 redraw
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
274 call assert_equal(normattr, screenattr(1, 1))
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
275 bwipe!
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
276 bwipe!
4b4ba6589a98 commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents: 9701
diff changeset
277 endfunc
10295
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
278
11430
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
279 func Test_diffopt_icase()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
280 set diffopt=icase,foldcolumn:0
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
281
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
282 e one
12315
40ee9f3d265f patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents: 11430
diff changeset
283 call setline(1, ['One', 'Two', 'Three', 'Four', 'Fi#ve'])
11430
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
284 redraw
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
285 let normattr = screenattr(1, 1)
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
286 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
287
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
288 botright vert new two
12315
40ee9f3d265f patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents: 11430
diff changeset
289 call setline(1, ['one', 'TWO', 'Three ', 'Four', 'fI=VE'])
11430
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
290 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
291
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
292 redraw
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
293 call assert_equal(normattr, screenattr(1, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
294 call assert_equal(normattr, screenattr(2, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
295 call assert_notequal(normattr, screenattr(3, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
296 call assert_equal(normattr, screenattr(4, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
297
12315
40ee9f3d265f patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents: 11430
diff changeset
298 let dtextattr = screenattr(5, 3)
40ee9f3d265f patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents: 11430
diff changeset
299 call assert_notequal(dtextattr, screenattr(5, 1))
40ee9f3d265f patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents: 11430
diff changeset
300 call assert_notequal(dtextattr, screenattr(5, 5))
40ee9f3d265f patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents: 11430
diff changeset
301
11430
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
302 diffoff!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
303 %bwipe!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
304 set diffopt&
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
305 endfunc
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
306
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
307 func Test_diffopt_iwhite()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
308 set diffopt=iwhite,foldcolumn:0
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
309
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
310 e one
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
311 " Difference in trailing spaces should be ignored,
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
312 " but not other space differences.
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
313 call setline(1, ["One \t", 'Two', 'Three', 'Four'])
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
314 redraw
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
315 let normattr = screenattr(1, 1)
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
316 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
317
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
318 botright vert new two
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
319 call setline(1, ["One\t ", "Two\t ", 'Three', ' Four'])
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
320 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
321
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
322 redraw
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
323 call assert_equal(normattr, screenattr(1, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
324 call assert_equal(normattr, screenattr(2, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
325 call assert_equal(normattr, screenattr(3, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
326 call assert_notequal(normattr, screenattr(4, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
327
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
328 diffoff!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
329 %bwipe!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
330 set diffopt&
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
331 endfunc
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
332
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
333 func Test_diffopt_context()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
334 enew!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
335 call setline(1, ['1', '2', '3', '4', '5', '6', '7'])
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
336 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
337 new
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
338 call setline(1, ['1', '2', '3', '4', '5x', '6', '7'])
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
339 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
340
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
341 set diffopt=context:2
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
342 call assert_equal('+-- 2 lines: 1', foldtextresult(1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
343 set diffopt=context:1
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
344 call assert_equal('+-- 3 lines: 1', foldtextresult(1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
345
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
346 diffoff!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
347 %bwipe!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
348 set diffopt&
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
349 endfunc
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
350
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
351 func Test_diffopt_horizontal()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
352 set diffopt=horizontal
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
353 diffsplit
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
354
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
355 call assert_equal(&columns, winwidth(1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
356 call assert_equal(&columns, winwidth(2))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
357 call assert_equal(&lines, winheight(1) + winheight(2) + 3)
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
358 call assert_inrange(0, 1, winheight(1) - winheight(2))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
359
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
360 set diffopt&
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
361 diffoff!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
362 %bwipe
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
363 endfunc
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
364
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
365 func Test_diffopt_vertical()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
366 set diffopt=vertical
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
367 diffsplit
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
368
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
369 call assert_equal(&lines - 2, winheight(1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
370 call assert_equal(&lines - 2, winheight(2))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
371 call assert_equal(&columns, winwidth(1) + winwidth(2) + 1)
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
372 call assert_inrange(0, 1, winwidth(1) - winwidth(2))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
373
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
374 set diffopt&
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
375 diffoff!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
376 %bwipe
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
377 endfunc
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
378
10821
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
379 func Test_diffoff_hidden()
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
380 set diffopt=filler,foldcolumn:0
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
381 e! one
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
382 call setline(1, ['Two', 'Three'])
11430
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
383 redraw
10821
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
384 let normattr = screenattr(1, 1)
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
385 diffthis
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
386 botright vert new two
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
387 call setline(1, ['One', 'Four'])
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
388 diffthis
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
389 redraw
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
390 call assert_notequal(normattr, screenattr(1, 1))
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
391 set hidden
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
392 close
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
393 redraw
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
394 " diffing with hidden buffer two
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
395 call assert_notequal(normattr, screenattr(1, 1))
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
396 diffoff
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
397 redraw
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
398 call assert_equal(normattr, screenattr(1, 1))
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
399 diffthis
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
400 redraw
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
401 " still diffing with hidden buffer two
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
402 call assert_notequal(normattr, screenattr(1, 1))
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
403 diffoff!
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
404 redraw
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
405 call assert_equal(normattr, screenattr(1, 1))
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
406 diffthis
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
407 redraw
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
408 " no longer diffing with hidden buffer two
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
409 call assert_equal(normattr, screenattr(1, 1))
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
410
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
411 bwipe!
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
412 bwipe!
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
413 set hidden& diffopt&
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
414 endfunc
d9e48fb5142f patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents: 10295
diff changeset
415
10295
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
416 func Test_setting_cursor()
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
417 new Xtest1
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
418 put =range(1,90)
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
419 wq
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
420 new Xtest2
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
421 put =range(1,100)
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
422 wq
12549
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
423
10295
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
424 tabe Xtest2
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
425 $
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
426 diffsp Xtest1
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
427 tabclose
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
428
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
429 call delete('Xtest1')
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
430 call delete('Xtest2')
d0b74b18e4b5 commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents: 10005
diff changeset
431 endfunc
10984
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
432
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
433 func Test_diff_move_to()
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
434 new
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
435 call setline(1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
436 diffthis
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
437 vnew
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
438 call setline(1, [1, '2x', 3, 4, 4, 5, '6x', 7, '8x', 9, '10x'])
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
439 diffthis
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
440 norm ]c
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
441 call assert_equal(2, line('.'))
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
442 norm 3]c
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
443 call assert_equal(9, line('.'))
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
444 norm 10]c
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
445 call assert_equal(11, line('.'))
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
446 norm [c
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
447 call assert_equal(9, line('.'))
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
448 norm 2[c
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
449 call assert_equal(5, line('.'))
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
450 norm 10[c
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
451 call assert_equal(2, line('.'))
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
452 %bwipe!
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
453 endfunc
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
454
11430
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
455 func Test_diffexpr()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
456 if !executable('diff')
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
457 return
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
458 endif
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
459
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
460 func DiffExpr()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
461 silent exe '!diff ' . v:fname_in . ' ' . v:fname_new . '>' . v:fname_out
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
462 endfunc
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
463 set diffexpr=DiffExpr()
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
464 set diffopt=foldcolumn:0
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
465
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
466 enew!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
467 call setline(1, ['one', 'two', 'three'])
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
468 redraw
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
469 let normattr = screenattr(1, 1)
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
470 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
471
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
472 botright vert new
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
473 call setline(1, ['one', 'two', 'three.'])
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
474 diffthis
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
475
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
476 redraw
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
477 call assert_equal(normattr, screenattr(1, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
478 call assert_equal(normattr, screenattr(2, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
479 call assert_notequal(normattr, screenattr(3, 1))
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
480
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
481 diffoff!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
482 %bwipe!
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
483 set diffexpr& diffopt&
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
484 endfunc
eba1a8c6e21d patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 11113
diff changeset
485
10984
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
486 func Test_diffpatch()
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
487 " The patch program on MS-Windows may fail or hang.
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
488 if !executable('patch') || !has('unix')
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
489 return
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
490 endif
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
491 new
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
492 insert
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
493 ***************
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
494 *** 1,3 ****
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
495 1
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
496 ! 2
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
497 3
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
498 --- 1,4 ----
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
499 1
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
500 ! 2x
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
501 3
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
502 + 4
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
503 .
12549
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
504 saveas! Xpatch
10984
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
505 bwipe!
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
506 new
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
507 call assert_fails('diffpatch Xpatch', 'E816:')
11109
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
508
11113
081ed9efb5c0 patch 8.0.0444: diffpatch fails when the file name has a quote
Christian Brabandt <cb@256bit.org>
parents: 11109
diff changeset
509 for name in ['Xpatch', 'Xpatch$HOME', 'Xpa''tch']
11109
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
510 call setline(1, ['1', '2', '3'])
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
511 if name != 'Xpatch'
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
512 call rename('Xpatch', name)
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
513 endif
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
514 exe 'diffpatch ' . escape(name, '$')
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
515 call assert_equal(['1', '2x', '3', '4'], getline(1, '$'))
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
516 if name != 'Xpatch'
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
517 call rename(name, 'Xpatch')
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
518 endif
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
519 bwipe!
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
520 endfor
0adcfcf22036 patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
521
10984
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
522 call delete('Xpatch')
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
523 bwipe!
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
524 endfunc
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
525
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
526 func Test_diff_too_many_buffers()
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
527 for i in range(1, 8)
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
528 exe "new Xtest" . i
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
529 diffthis
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
530 endfor
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
531 new Xtest9
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
532 call assert_fails('diffthis', 'E96:')
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
533 %bwipe!
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
534 endfunc
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
535
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
536 func Test_diff_nomodifiable()
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
537 new
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
538 call setline(1, [1, 2, 3, 4])
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
539 setl nomodifiable
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
540 diffthis
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
541 vnew
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
542 call setline(1, ['1x', 2, 3, 3, 4])
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
543 diffthis
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
544 call assert_fails('norm dp', 'E793:')
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
545 setl nomodifiable
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
546 call assert_fails('norm do', 'E21:')
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
547 %bwipe!
c0d5e8ab1452 patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10821
diff changeset
548 endfunc
11065
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
549
12549
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
550 func Test_diff_hlID()
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
551 new
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
552 call setline(1, [1, 2, 3])
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
553 diffthis
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
554 vnew
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
555 call setline(1, ['1x', 2, 'x', 3])
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
556 diffthis
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
557 redraw
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
558
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
559 call assert_equal(synIDattr(diff_hlID(-1, 1), "name"), "")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
560
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
561 call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
562 call assert_equal(synIDattr(diff_hlID(1, 2), "name"), "DiffText")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
563 call assert_equal(synIDattr(diff_hlID(2, 1), "name"), "")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
564 call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "DiffAdd")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
565 call assert_equal(synIDattr(diff_hlID(4, 1), "name"), "")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
566
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
567 wincmd w
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
568 call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
569 call assert_equal(synIDattr(diff_hlID(2, 1), "name"), "")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
570 call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "")
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
571
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
572 %bwipe!
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
573 endfunc
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
574
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
575 func Test_diff_filler()
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
576 new
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
577 call setline(1, [1, 2, 3, 'x', 4])
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
578 diffthis
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
579 vnew
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
580 call setline(1, [1, 2, 'y', 'y', 3, 4])
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
581 diffthis
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
582 redraw
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
583
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
584 call assert_equal([0, 0, 0, 0, 0, 0, 0, 1, 0], map(range(-1, 7), 'diff_filler(v:val)'))
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
585 wincmd w
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
586 call assert_equal([0, 0, 0, 0, 2, 0, 0, 0], map(range(-1, 6), 'diff_filler(v:val)'))
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
587
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
588 %bwipe!
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
589 endfunc
62e8cef76508 patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents: 12315
diff changeset
590
11065
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
591 func Test_diff_lastline()
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
592 enew!
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
593 only!
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
594 call setline(1, ['This is a ', 'line with five ', 'rows'])
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
595 diffthis
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
596 botright vert new
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
597 call setline(1, ['This is', 'a line with ', 'four rows'])
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
598 diffthis
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
599 1
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
600 call feedkeys("Je a\<CR>", 'tx')
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
601 call feedkeys("Je a\<CR>", 'tx')
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
602 let w1lines = winline()
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
603 wincmd w
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
604 $
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
605 let w2lines = winline()
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
606 call assert_equal(w2lines, w1lines)
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
607 bwipe!
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
608 bwipe!
f5bd684e47a1 patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents: 10984
diff changeset
609 endfunc