annotate src/testdir/test_marks.vim @ 14305:8a4c0ab88201 v8.1.0168

patch 8.1.0168: output of :marks is too short with multi-byte chars commit https://github.com/vim/vim/commit/9d5185bf9dfaef59e47c573a60044a21d5e29c0c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 8 17:57:34 2018 +0200 patch 8.1.0168: output of :marks is too short with multi-byte chars Problem: Output of :marks is too short with multi-byte chars. (Tony Mechelynck) Solution: Get more bytes from the text line.
author Christian Brabandt <cb@256bit.org>
date Sun, 08 Jul 2018 18:00:07 +0200
parents 3b600d16d9cb
children f7e80dbb4f00
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10068
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Test that a deleted mark is restored after delete-undo-redo-undo.
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 function! Test_Restore_DelMark()
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 enew!
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 call append(0, [" textline A", " textline B", " textline C"])
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 normal! 2gg
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 set nocp viminfo+=nviminfo
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 exe "normal! i\<C-G>u\<Esc>"
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 exe "normal! maddu\<C-R>u"
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 let pos = getpos("'a")
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 call assert_equal(2, pos[1])
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 call assert_equal(1, pos[2])
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 enew!
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 endfunction
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 " Test that CTRL-A and CTRL-X updates last changed mark '[, '].
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 function! Test_Incr_Marks()
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 enew!
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call append(0, ["123 123 123", "123 123 123", "123 123 123"])
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 normal! gg
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX"
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_equal("AAA 123 123", getline(1))
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 call assert_equal("123 XXXXXXX", getline(2))
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal("XXX 123 123", getline(3))
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 enew!
c577c6a2e88b commit https://github.com/vim/vim/commit/19a1669ffc796e30a83c5600f82f12ebf63a2261
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 endfunction
10730
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
27
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
28 func Test_setpos()
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
29 new one
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
30 let onebuf = bufnr('%')
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
31 let onewin = win_getid()
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
32 call setline(1, ['aaa', 'bbb', 'ccc'])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
33 new two
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
34 let twobuf = bufnr('%')
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
35 let twowin = win_getid()
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
36 call setline(1, ['aaa', 'bbb', 'ccc'])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
37
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
38 " for the cursor the buffer number is ignored
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
39 call setpos(".", [0, 2, 1, 0])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
40 call assert_equal([0, 2, 1, 0], getpos("."))
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
41 call setpos(".", [onebuf, 3, 3, 0])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
42 call assert_equal([0, 3, 3, 0], getpos("."))
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
43
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
44 call setpos("''", [0, 1, 3, 0])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
45 call assert_equal([0, 1, 3, 0], getpos("''"))
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
46 call setpos("''", [onebuf, 2, 2, 0])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
47 call assert_equal([0, 2, 2, 0], getpos("''"))
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
48
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
49 " buffer-local marks
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
50 for mark in ["'a", "'\"", "'[", "']", "'<", "'>"]
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
51 call win_gotoid(twowin)
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
52 call setpos(mark, [0, 2, 1, 0])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
53 call assert_equal([0, 2, 1, 0], getpos(mark), "for mark " . mark)
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
54 call setpos(mark, [onebuf, 1, 3, 0])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
55 call win_gotoid(onewin)
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
56 call assert_equal([0, 1, 3, 0], getpos(mark), "for mark " . mark)
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
57 endfor
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
58
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
59 " global marks
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
60 call win_gotoid(twowin)
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
61 call setpos("'N", [0, 2, 1, 0])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
62 call assert_equal([twobuf, 2, 1, 0], getpos("'N"))
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
63 call setpos("'N", [onebuf, 1, 3, 0])
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
64 call assert_equal([onebuf, 1, 3, 0], getpos("'N"))
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
65
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
66 call win_gotoid(onewin)
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
67 bwipe!
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
68 call win_gotoid(twowin)
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
69 bwipe!
44e9340dc604 patch 8.0.0255: setpos() does not use the buffer argument for all marks
Christian Brabandt <cb@256bit.org>
parents: 10068
diff changeset
70 endfunc
12612
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
71
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
72 func Test_marks_cmd()
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
73 new Xone
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
74 call setline(1, ['aaa', 'bbb'])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
75 norm! maG$mB
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
76 w!
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
77 new Xtwo
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
78 call setline(1, ['ccc', 'ddd'])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
79 norm! $mcGmD
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
80 w!
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
81
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
82 b Xone
14305
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
83 let a = split(execute('marks'), "\n")
12612
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
84 call assert_equal(9, len(a))
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
85 call assert_equal('mark line col file/text', a[0])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
86 call assert_equal(" ' 2 0 bbb", a[1])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
87 call assert_equal(' a 1 0 aaa', a[2])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
88 call assert_equal(' B 2 2 bbb', a[3])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
89 call assert_equal(' D 2 0 Xtwo', a[4])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
90 call assert_equal(' " 1 0 aaa', a[5])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
91 call assert_equal(' [ 1 0 aaa', a[6])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
92 call assert_equal(' ] 2 0 bbb', a[7])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
93 call assert_equal(' . 2 0 bbb', a[8])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
94
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
95 b Xtwo
14305
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
96 let a = split(execute('marks'), "\n")
12612
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
97 call assert_equal(9, len(a))
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
98 call assert_equal('mark line col file/text', a[0])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
99 call assert_equal(" ' 1 0 ccc", a[1])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
100 call assert_equal(' c 1 2 ccc', a[2])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
101 call assert_equal(' B 2 2 Xone', a[3])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
102 call assert_equal(' D 2 0 ddd', a[4])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
103 call assert_equal(' " 2 0 ddd', a[5])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
104 call assert_equal(' [ 1 0 ccc', a[6])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
105 call assert_equal(' ] 2 0 ddd', a[7])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
106 call assert_equal(' . 2 0 ddd', a[8])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
107
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
108 b Xone
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
109 delmarks aB
14305
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
110 let a = split(execute('marks aBcD'), "\n")
12612
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
111 call assert_equal(2, len(a))
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
112 call assert_equal('mark line col file/text', a[0])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
113 call assert_equal(' D 2 0 Xtwo', a[1])
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
114
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
115 b Xtwo
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
116 delmarks cD
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
117 call assert_fails('marks aBcD', 'E283:')
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
118
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
119 call delete('Xone')
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
120 call delete('Xtwo')
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
121 %bwipe
3b600d16d9cb patch 8.0.1184: the :marks command is not tested
Christian Brabandt <cb@256bit.org>
parents: 10730
diff changeset
122 endfunc
14305
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
123
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
124 func Test_marks_cmd_multibyte()
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
125 if !has('multi_byte')
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
126 return
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
127 endif
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
128 new Xone
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
129 call setline(1, ['ááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááááá'])
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
130 norm! ma
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
131
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
132 let a = split(execute('marks a'), "\n")
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
133 call assert_equal(2, len(a))
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
134 let expected = ' a 1 0 '
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
135 while strwidth(expected) < &columns - 1
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
136 let expected .= 'á'
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
137 endwhile
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
138 call assert_equal(expected, a[1])
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
139
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
140 bwipe!
8a4c0ab88201 patch 8.1.0168: output of :marks is too short with multi-byte chars
Christian Brabandt <cb@256bit.org>
parents: 12612
diff changeset
141 endfunc