annotate src/testdir/test_listlbr.vim @ 35185:3a4fd6867abf default tip

runtime(doc): Remove trailing spaces (#14784) Commit: https://github.com/vim/vim/commit/c0e038b59f8445e46043b6c19a70395562b068aa Author: K.Takata <kentkt@csc.jp> Date: Thu May 16 12:39:01 2024 +0900 runtime(doc): Remove trailing spaces (https://github.com/vim/vim/issues/14784) Fix the issues introduced by https://github.com/vim/vim/issues/14770.
author Christian Brabandt <cb@256bit.org>
date Thu, 16 May 2024 05:45:08 +0200
parents f9b706e23b10
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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)
32971
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
18 call assert_equal(a:expect, a:actual)
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
32084
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
76 func Test_linebreak_with_list_and_number()
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
77 call s:test_windows('setl list listchars+=tab:>-')
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
78 call setline(1, ["abcdefg\thijklmnopqrstu", "v"])
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
79 let lines = s:screen_lines([1, 4], winwidth(0))
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
80 let expect_nonumber = [
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
81 \ "abcdefg>------------",
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
82 \ "hijklmnopqrstu$ ",
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
83 \ "v$ ",
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
84 \ "~ ",
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
85 \ ]
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
86 call s:compare_lines(expect_nonumber, lines)
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
87
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
88 setl number
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
89 let lines = s:screen_lines([1, 4], winwidth(0))
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
90 let expect_number = [
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
91 \ " 1 abcdefg>--------",
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
92 \ " hijklmnopqrstu$ ",
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
93 \ " 2 v$ ",
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
94 \ "~ ",
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
95 \ ]
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
96 call s:compare_lines(expect_number, lines)
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
97 call s:close_windows()
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
98 endfunc
fe1550f920d8 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Bram Moolenaar <Bram@vim.org>
parents: 30735
diff changeset
99
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 func Test_should_break()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 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
102 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
103 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
104 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 \ "1 ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 \ "+aaaaaaaaaaaaaaaaaa ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 func Test_linebreak_with_conceal()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 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
116 call setline(1, "_S_\t bla")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117 syn match ConcealVar contained /_/ conceal
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118 syn match All /.*/ contains=ConcealVar
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119 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
120 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 \ "Sabbbbbb bla ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129
19176
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
130 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
131 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
132 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
133 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
134
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
135 " yank
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
136 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
137 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
138 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
139 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
140
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
141 " 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
142 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
143 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
144
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
145 " replace
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
146 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
147 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
148
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
149 " tilde
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
150 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
151 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
152
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
153 " 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
154 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
155 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
156 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
157
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
158 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
159 endfunc
be81baeb69f8 patch 8.2.0147: block Visual mode operators not correct when 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
160
30735
09a61a174259 patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 30725
diff changeset
161 " 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
162 " '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
163 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
164 CheckScreendump
1cbb01bc75c3 patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents: 30630
diff changeset
165
30735
09a61a174259 patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 30725
diff changeset
166 " 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
167 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
168 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
169 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
170 END
1cbb01bc75c3 patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents: 30630
diff changeset
171 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
172 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
173
30735
09a61a174259 patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 30725
diff changeset
174 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
175 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
176 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
177 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
178
09a61a174259 patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 30725
diff changeset
179 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
180 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
181 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
182 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
183
09a61a174259 patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 30725
diff changeset
184 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
185 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
186 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
187 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
188
09a61a174259 patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 30725
diff changeset
189 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
190 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
191 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
192 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
193 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
194
30735
09a61a174259 patch 9.0.0702: incomplete testing cursor position with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents: 30725
diff changeset
195 " clean up
30725
1cbb01bc75c3 patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents: 30630
diff changeset
196 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
197 call StopVimInTerminal(buf)
1cbb01bc75c3 patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents: 30630
diff changeset
198 endfunc
1cbb01bc75c3 patch 9.0.0697: cursor in wrong position with Visual substitute
Bram Moolenaar <Bram@vim.org>
parents: 30630
diff changeset
199
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
200 func Test_virtual_block()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
201 call s:test_windows('setl sbr=+')
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
202 call setline(1, [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
203 \ "REMOVE: this not",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
204 \ "REMOVE: aaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
205 \ ])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
206 exe "norm! 1/^REMOVE:"
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
207 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
208 $put
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
209 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
210 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
211 \ "this not ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
212 \ "aaaaaaaaaaaaa ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
213 \ "REMOVE: ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
214 \ "REMOVE: ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
215 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
216 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
217 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
218 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
219
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
220 func Test_virtual_block_and_vbA()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
221 call s:test_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
222 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
223 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
224 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
225 let expect = [
30630
218363931f5d patch 9.0.0650: some tests are failing
Bram Moolenaar <Bram@vim.org>
parents: 23952
diff changeset
226 \ "<<<bar foobar ",
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
227 \ "foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
228 \ "foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
229 \ "foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
230 \ "foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
231 \ "foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
232 \ "foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
233 \ "foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
234 \ "foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
235 \ "foobar TARGETx at ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
236 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
237 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
238 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
239 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
240
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
241 func Test_virtual_char_and_block()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
242 call s:test_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
243 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
244 exe "norm! 0f-lv3lc2222\<Esc>bgj."
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
245 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
246 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
247 \ "1111-2222-1111-11- ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
248 \ "1111-2222-1111 ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
249 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
250 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
251 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
252 endfunc
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 func Test_undo_after_block_visual()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
255 call s:test_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
256 call setline(1, ["aaa", "aaa", "a"])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
257 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
258 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
259 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
260 \ "AaA ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
261 \ "AaA ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
262 \ "A ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
263 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
264 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
265 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
266 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
267
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
268 func Test_norm_after_block_visual()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
269 call s:test_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
270 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
271 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
272 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
273 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
274 \ "abcdpgrs ",
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 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
278 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
279 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
280 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
281
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
282 func Test_block_replace_after_wrapping()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
283 call s:test_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
284 call setline(1, repeat("a", 150))
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
285 exe "norm! 0yypk147|\<C-V>jr0"
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
286 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
287 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
288 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
289 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
290 \ "aaaaaaaaaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
291 \ "aaaaaaaaaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
292 \ "aaaaaaaaaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
293 \ "aaaaaaaaaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
294 \ "aaaaaaaaaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
295 \ "aaaaaaaaaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
296 \ "aaaaaaaaaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
297 \ "aaaaaa0aaa ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
298 \ "@ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
299 \ "@ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
300 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
301 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
302 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
303 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
304
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
305 func Test_list_with_listchars()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
306 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
307 call setline(1, "a aaaaaaaaaaaaaaaaaaaaaa\ta ")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
308 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
309 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
310 \ "a_ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
311 \ "aaaaaaaaaaaaaaaaaaaa",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
312 \ "aa>-----a-$ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
313 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
314 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
315 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
316 endfunc
11010
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
317
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
318 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
319 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
320 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
321 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
322 norm! 2zl
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
323 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
324 let expect = [
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
325 \ "---------------aaaaa",
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
326 \ "---------------aaaaa",
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
327 \ "---------------aaaaa",
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
328 \ "iiiiiiiii>-----aaaaa",
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
329 \ ]
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
330 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
331 call s:close_windows()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 19176
diff changeset
332 endfunc
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 19176
diff changeset
333
32971
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
334 func Test_ctrl_char_on_wrap_column()
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
335 call s:test_windows("setl nolbr wrap sbr=")
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
336 call setline(1, 'aaa' .. repeat("\<C-A>", 150) .. 'bbb')
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
337 call cursor(1,1)
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
338 norm! $
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
339 redraw!
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
340 let expect=[
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
341 \ '<<<^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
342 \ 'A^A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
343 \ 'A^A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
344 \ 'A^A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
345 \ 'A^A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
346 \ 'A^A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
347 \ 'A^A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
348 \ 'A^A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
349 \ 'A^A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
350 \ 'A^Abbb ']
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
351 let lines = s:screen_lines([1, 10], winwidth(0))
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
352 call s:compare_lines(expect, lines)
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
353 call assert_equal(len(expect), winline())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
354 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
355 setl sbr=!!
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
356 redraw!
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
357 let expect=[
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
358 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
359 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
360 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
361 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
362 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
363 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
364 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
365 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
366 \ '!!A^A^A^A^A^A^A^A^A^',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
367 \ '!!A^A^A^A^A^A^Abbb ']
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
368 let lines = s:screen_lines([1, 10], winwidth(0))
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
369 call s:compare_lines(expect, lines)
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
370 call assert_equal(len(expect), winline())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
371 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
372 call s:close_windows()
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
373 endfunc
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 32084
diff changeset
374
33536
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
375 func Test_linebreak_no_break_after_whitespace_only()
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
376 call s:test_windows('setl ts=4 linebreak wrap')
34211
f9b706e23b10 patch 9.1.0054: 'linebreak' may still apply to leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 33536
diff changeset
377 call setline(1, "\t abcdefghijklmnopqrstuvwxyz" ..
33536
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
378 \ "abcdefghijklmnopqrstuvwxyz")
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
379 let lines = s:screen_lines([1, 4], winwidth(0))
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
380 let expect = [
34211
f9b706e23b10 patch 9.1.0054: 'linebreak' may still apply to leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 33536
diff changeset
381 \ " abcdefghijklmn",
f9b706e23b10 patch 9.1.0054: 'linebreak' may still apply to leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 33536
diff changeset
382 \ "opqrstuvwxyzabcdefgh",
f9b706e23b10 patch 9.1.0054: 'linebreak' may still apply to leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 33536
diff changeset
383 \ "ijklmnopqrstuvwxyz ",
33536
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
384 \ "~ ",
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
385 \ ]
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
386 call s:compare_lines(expect, lines)
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
387 call s:close_windows()
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
388 endfunc
886e7c8f7614 patch 9.0.2017: linebreak applies for leading whitespace
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
389
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 19176
diff changeset
390 " vim: shiftwidth=2 sts=2 expandtab