Mercurial > vim
annotate src/testdir/test_listlbr.vim @ 30847:2c03ff81cbcb v9.0.0758
patch 9.0.0758: "precedes" from 'listchars' overwritten by <<<
Commit: https://github.com/vim/vim/commit/13cdde39520220bb856cba16626327c706752b51
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 15 14:07:48 2022 +0100
patch 9.0.0758: "precedes" from 'listchars' overwritten by <<<
Problem: "precedes" from 'listchars' overwritten by <<< for 'smoothscroll'.
Solution: Keep the "precedes" character.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 15 Oct 2022 15:15:03 +0200 |
parents | 09a61a174259 |
children | fe1550f920d8 |
rev | line source |
---|---|
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for linebreak and list option (non-utf8) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 set encoding=latin1 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 scriptencoding latin1 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
17049
diff
changeset
|
6 source check.vim |
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
17049
diff
changeset
|
7 CheckOption linebreak |
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
17049
diff
changeset
|
8 CheckFeature conceal |
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 source view_util.vim |
30725
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
11 source screendump.vim |
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 function s:screen_lines(lnum, width) abort |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 return ScreenLines(a:lnum, a:width) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 endfunction |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
11010
diff
changeset
|
17 func s:compare_lines(expect, actual) |
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call assert_equal(join(a:expect, "\n"), join(a:actual, "\n")) |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
11010
diff
changeset
|
19 endfunc |
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 function s:test_windows(...) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call NewWindow(10, 20) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 setl ts=8 sw=4 sts=4 linebreak sbr= wrap |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 exe get(a:000, 0, '') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 endfunction |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 function s:close_windows(...) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call CloseWindow() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 exe get(a:000, 0, '') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 endfunction |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 func Test_set_linebreak() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 call s:test_windows('setl ts=4 sbr=+') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 call setline(1, "\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP ") |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 let lines = s:screen_lines([1, 4], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 \ " abcdef ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 \ "+hijklmn ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 \ "+pqrstuvwxyz_1060ABC", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 \ "+DEFGHIJKLMNOP ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 func Test_linebreak_with_list() |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
47 set listchars= |
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 call s:test_windows('setl ts=4 sbr=+ list listchars=') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 call setline(1, "\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP ") |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 let lines = s:screen_lines([1, 4], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 \ "^Iabcdef hijklmn^I ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 \ "+pqrstuvwxyz_1060ABC", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 \ "+DEFGHIJKLMNOP ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 \ "~ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 call s:close_windows() |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
59 set listchars&vim |
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 func Test_linebreak_with_nolist() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 call s:test_windows('setl ts=4 sbr=+ nolist') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 call setline(1, "\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP ") |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 let lines = s:screen_lines([1, 4], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 \ " abcdef ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 \ "+hijklmn ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 \ "+pqrstuvwxyz_1060ABC", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 \ "+DEFGHIJKLMNOP ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 func Test_should_break() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 call s:test_windows('setl sbr=+ nolist') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 call setline(1, "1\t" . repeat('a', winwidth(0)-2)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 let lines = s:screen_lines([1, 4], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 \ "1 ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 \ "+aaaaaaaaaaaaaaaaaa ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 \ "~ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 \ "~ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 func Test_linebreak_with_conceal() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 call s:test_windows('setl cpo&vim sbr=+ list conceallevel=2 concealcursor=nv listchars=tab:ab') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 call setline(1, "_S_\t bla") |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 syn match ConcealVar contained /_/ conceal |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 syn match All /.*/ contains=ConcealVar |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 let lines = s:screen_lines([1, 4], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 \ "Sabbbbbb bla ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 \ "~ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 \ "~ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 \ "~ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 |
19176
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
106 func Test_linebreak_with_visual_operations() |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
107 call s:test_windows() |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
108 let line = '1234567890 2234567890 3234567890' |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
109 call setline(1, line) |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
110 |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
111 " yank |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
112 exec "norm! ^w\<C-V>ey" |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
113 call assert_equal('2234567890', @@) |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
114 exec "norm! w\<C-V>ey" |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
115 call assert_equal('3234567890', @@) |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
116 |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
117 " increment / decrement |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
118 exec "norm! ^w\<C-V>\<C-A>w\<C-V>\<C-X>" |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
119 call assert_equal('1234567890 3234567890 2234567890', getline(1)) |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
120 |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
121 " replace |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
122 exec "norm! ^w\<C-V>3lraw\<C-V>3lrb" |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
123 call assert_equal('1234567890 aaaa567890 bbbb567890', getline(1)) |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
124 |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
125 " tilde |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
126 exec "norm! ^w\<C-V>2l~w\<C-V>2l~" |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
127 call assert_equal('1234567890 AAAa567890 BBBb567890', getline(1)) |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
128 |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
129 " delete and insert |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
130 exec "norm! ^w\<C-V>3lc2345\<Esc>w\<C-V>3lc3456\<Esc>" |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
131 call assert_equal('1234567890 2345567890 3456567890', getline(1)) |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
132 call assert_equal('BBBb', @@) |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
133 |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
134 call s:close_windows() |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
135 endfunc |
be81baeb69f8
patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
136 |
30735
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
137 " Test that cursor is drawn at correct position after an operator when |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
138 " 'linebreak' is enabled. |
30725
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
139 func Test_linebreak_reset_restore() |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
140 CheckScreendump |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
141 |
30735
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
142 " f_wincol() calls validate_cursor() |
30725
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
143 let lines =<< trim END |
30735
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
144 set linebreak showcmd noshowmode formatexpr=wincol()-wincol() |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
145 call setline(1, repeat('a', &columns - 10) .. ' bbbbbbbbbb c') |
30725
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
146 END |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
147 call writefile(lines, 'XlbrResetRestore', 'D') |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
148 let buf = RunVimInTerminal('-S XlbrResetRestore', {'rows': 8}) |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
149 |
30735
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
150 call term_sendkeys(buf, '$v$') |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
151 call WaitForAssert({-> assert_equal(13, term_getcursor(buf)[1])}) |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
152 call term_sendkeys(buf, 'zo') |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
153 call WaitForAssert({-> assert_equal(12, term_getcursor(buf)[1])}) |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
154 |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
155 call term_sendkeys(buf, '$v$') |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
156 call WaitForAssert({-> assert_equal(13, term_getcursor(buf)[1])}) |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
157 call term_sendkeys(buf, 'gq') |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
158 call WaitForAssert({-> assert_equal(12, term_getcursor(buf)[1])}) |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
159 |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
160 call term_sendkeys(buf, "$\<C-V>$") |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
161 call WaitForAssert({-> assert_equal(13, term_getcursor(buf)[1])}) |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
162 call term_sendkeys(buf, 'I') |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
163 call WaitForAssert({-> assert_equal(12, term_getcursor(buf)[1])}) |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
164 |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
165 call term_sendkeys(buf, "\<Esc>$v$") |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
166 call WaitForAssert({-> assert_equal(13, term_getcursor(buf)[1])}) |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
167 call term_sendkeys(buf, 's') |
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
168 call WaitForAssert({-> assert_equal(12, term_getcursor(buf)[1])}) |
30725
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
169 call VerifyScreenDump(buf, 'Test_linebreak_reset_restore_1', {}) |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
170 |
30735
09a61a174259
patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
30725
diff
changeset
|
171 " clean up |
30725
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
172 call term_sendkeys(buf, "\<Esc>") |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
173 call StopVimInTerminal(buf) |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
174 endfunc |
1cbb01bc75c3
patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents:
30630
diff
changeset
|
175 |
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 func Test_virtual_block() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 call s:test_windows('setl sbr=+') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 call setline(1, [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 \ "REMOVE: this not", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 \ "REMOVE: aaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 \ ]) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 exe "norm! 1/^REMOVE:" |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 exe "norm! 0\<C-V>jf x" |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 $put |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 let lines = s:screen_lines([1, 4], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 \ "this not ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
188 \ "aaaaaaaaaaaaa ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 \ "REMOVE: ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
190 \ "REMOVE: ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
191 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
193 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
194 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
195 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 func Test_virtual_block_and_vbA() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 call s:test_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 call setline(1, "long line: " . repeat("foobar ", 40) . "TARGET at end") |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
199 exe "norm! $3B\<C-v>eAx\<Esc>" |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 let lines = s:screen_lines([1, 10], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
201 let expect = [ |
30630
218363931f5d
patch 9.0.0650: some tests are failing
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
202 \ "<<<bar foobar ", |
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 \ "foobar foobar ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 \ "foobar foobar ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 \ "foobar foobar ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
206 \ "foobar foobar ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
207 \ "foobar foobar ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
208 \ "foobar foobar ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
209 \ "foobar foobar ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
210 \ "foobar foobar ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
211 \ "foobar TARGETx at ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
212 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
213 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
214 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
215 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
216 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
217 func Test_virtual_char_and_block() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
218 call s:test_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
219 call setline(1, "1111-1111-1111-11-1111-1111-1111") |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
220 exe "norm! 0f-lv3lc2222\<Esc>bgj." |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
221 let lines = s:screen_lines([1, 2], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
222 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
223 \ "1111-2222-1111-11- ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
224 \ "1111-2222-1111 ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
225 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
226 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
227 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
228 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
229 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
230 func Test_undo_after_block_visual() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
231 call s:test_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
232 call setline(1, ["aaa", "aaa", "a"]) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
233 exe "norm! gg\<C-V>2j~e." |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
234 let lines = s:screen_lines([1, 3], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
235 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
236 \ "AaA ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
237 \ "AaA ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
238 \ "A ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
239 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
240 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
241 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
242 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
243 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
244 func Test_norm_after_block_visual() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
245 call s:test_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
246 call setline(1, ["abcd{ef", "ghijklm", "no}pgrs"]) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
247 exe "norm! ggf{\<C-V>\<C-V>c%" |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
248 let lines = s:screen_lines([1, 3], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
249 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
250 \ "abcdpgrs ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
251 \ "~ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
252 \ "~ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
253 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
254 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
255 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
256 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
257 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
258 func Test_block_replace_after_wrapping() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
259 call s:test_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
260 call setline(1, repeat("a", 150)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
261 exe "norm! 0yypk147|\<C-V>jr0" |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
262 call assert_equal(repeat("a", 146) . "0aaa", getline(1)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
263 call assert_equal(repeat("a", 146) . "0aaa", getline(2)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
264 let lines = s:screen_lines([1, 10], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
265 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
266 \ "aaaaaaaaaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
267 \ "aaaaaaaaaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
268 \ "aaaaaaaaaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
269 \ "aaaaaaaaaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
270 \ "aaaaaaaaaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
271 \ "aaaaaaaaaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
272 \ "aaaaaaaaaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
273 \ "aaaaaa0aaa ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
274 \ "@ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
275 \ "@ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
276 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
277 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
278 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
279 endfunc |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
280 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
281 func Test_list_with_listchars() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
282 call s:test_windows('setl list listchars=space:_,trail:-,tab:>-,eol:$') |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
283 call setline(1, "a aaaaaaaaaaaaaaaaaaaaaa\ta ") |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
284 let lines = s:screen_lines([1, 3], winwidth(0)) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
285 let expect = [ |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
286 \ "a_ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
287 \ "aaaaaaaaaaaaaaaaaaaa", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
288 \ "aa>-----a-$ ", |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
289 \ ] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
290 call s:compare_lines(expect, lines) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
291 call s:close_windows() |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
292 endfunc |
11010
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
293 |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
294 func Test_list_with_tab_and_skipping_first_chars() |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
295 call s:test_windows('setl list listchars=tab:>- ts=70 nowrap') |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
296 call setline(1, ["iiiiiiiiiiiiiiii\taaaaaaaaaaaaaaaaaa", "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii\taaaaaaaaaaaaaaaaaa", "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii\taaaaaaaaaaaaaaaaaa", "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii\taaaaaaaaaaaaaaaaaa"]) |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
297 call cursor(4,64) |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
298 norm! 2zl |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
299 let lines = s:screen_lines([1, 4], winwidth(0)) |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
300 let expect = [ |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
301 \ "---------------aaaaa", |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
302 \ "---------------aaaaa", |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
303 \ "---------------aaaaa", |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
304 \ "iiiiiiiii>-----aaaaa", |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
305 \ ] |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
306 call s:compare_lines(expect, lines) |
c004e17fa36b
patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents:
10843
diff
changeset
|
307 call s:close_windows() |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
19176
diff
changeset
|
308 endfunc |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
19176
diff
changeset
|
309 |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
19176
diff
changeset
|
310 " vim: shiftwidth=2 sts=2 expandtab |