annotate src/testdir/test_listlbr_utf8.vim @ 35167:6dddafdbe6f9 default tip

Added tag v9.1.0409 for changeset 0b259135fb3a4ce87fc1ff0673ae9b61cb7ed555
author Christian Brabandt <cb@256bit.org>
date Sun, 12 May 2024 00:15:05 +0200
parents 5525b635ed4a
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 in utf-8 mode
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=utf-8
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 scriptencoding utf-8
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
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
9 CheckFeature signs
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 source view_util.vim
34298
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
12 source screendump.vim
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
14 func s:screen_lines(lnum, width) abort
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 return ScreenLines(a:lnum, a:width)
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
16 endfunc
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
18 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
19 call assert_equal(a:expect, a:actual)
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
20 endfunc
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
22 func s:screen_attr(lnum, chars, ...) abort
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 let line = getline(a:lnum)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 let attr = []
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 let prefix = get(a:000, 0, 0)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 for i in range(a:chars[0], a:chars[1])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 let scol = strdisplaywidth(strcharpart(line, 0, i-1)) + 1
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 let attr += [screenattr(a:lnum, scol + prefix)]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 endfor
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 return attr
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
31 endfunc
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
33 func s:test_windows(...)
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 call NewWindow(10, 20)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 setl ts=4 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
36 exe get(a:000, 0, '')
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
37 endfunc
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
39 func s:close_windows(...)
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 call CloseWindow()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 exe get(a:000, 0, '')
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 11585
diff changeset
42 endfunc
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 func Test_linebreak_with_fancy_listchars()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 call s:test_windows("setl list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 call setline(1, "\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP ")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 redraw!
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 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
49 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 \ "▕———abcdef ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 \ "+hijklmn▕——— ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 \ "+pqrstuvwxyz␣1060ABC",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 \ "+DEFGHIJKLMNOPˑ¶ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 func Test_nolinebreak_with_list()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 call s:test_windows("setl nolinebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 call setline(1, "\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP ")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 redraw!
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 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
64 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 \ "▕———abcdef hijklmn▕—",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 \ "+pqrstuvwxyz␣1060ABC",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 \ "+DEFGHIJKLMNOPˑ¶ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73
25749
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
74 " this was causing a crash
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
75 func Test_linebreak_with_list_and_tabs()
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
76 set linebreak list listchars=tab:⇤\ ⇥ tabstop=100
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
77 new
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
78 call setline(1, "\t\t\ttext")
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
79 redraw
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
80 bwipe!
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
81 set nolinebreak nolist listchars&vim tabstop=8
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
82 endfunc
24b80aa4dd2e patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
83
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 func Test_linebreak_with_nolist()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 call s:test_windows('setl nolist')
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 call setline(1, "\t*mask = nil;")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 redraw!
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 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
89 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 \ " *mask = nil; ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 \ "~ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 endfunc
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 func Test_list_and_concealing1()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 call s:test_windows('setl list listchars=tab:>- cole=1')
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 call setline(1, [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 \ "#define ABCDE\t\t1",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 \ "#define ABCDEF\t\t1",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 \ "#define ABCDEFG\t\t1",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 \ "#define ABCDEFGH\t1",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 \ "#define MSG_MODE_FILE\t\t\t1",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 \ "#define MSG_MODE_CONSOLE\t\t2",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 \ "#define MSG_MODE_FILE_AND_CONSOLE\t3",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 \ "#define MSG_MODE_FILE_THEN_CONSOLE\t4",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 \ ])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 vert resize 40
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 syn match Conceal conceal cchar=>'AB\|MSG_MODE'
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113 redraw!
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 let lines = s:screen_lines([1, 7], winwidth(0))
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 \ "#define ABCDE>-->---1 ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117 \ "#define >CDEF>-->---1 ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118 \ "#define >CDEFG>->---1 ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119 \ "#define >CDEFGH>----1 ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 \ "#define >_FILE>--------->--->---1 ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 \ "#define >_CONSOLE>---------->---2 ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 \ "#define >_FILE_AND_CONSOLE>---------3 ",
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 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128 func Test_list_and_concealing2()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129 call s:test_windows('setl nowrap ts=2 list listchars=tab:>- cole=2 concealcursor=n')
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
130 call setline(1, "bbeeeeee\t\t;\tsome text")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
131 vert resize 40
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
132 syn clear
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
133 syn match meaning /;\s*\zs.*/
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134 syn match hasword /^\x\{8}/ contains=word
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
135 syn match word /\<\x\{8}\>/ contains=beginword,endword contained
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
136 syn match beginword /\<\x\x/ contained conceal
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137 syn match endword /\x\{6}\>/ contained
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
138 hi meaning guibg=blue
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
139 hi beginword guibg=green
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
140 hi endword guibg=red
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
141 redraw!
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
142 let lines = s:screen_lines([1, 1], winwidth(0))
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
143 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
144 \ "eeeeee>--->-;>some text ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
145 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
146 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
147 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
148 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
149
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
150 func Test_screenattr_for_comment()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
151 call s:test_windows("setl ft=c ts=7 list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
152 call setline(1, " /*\t\t and some more */")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
153 norm! gg0
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
154 syntax on
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
155 hi SpecialKey term=underline ctermfg=red guifg=red
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
156 redraw!
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
157 let line = getline(1)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
158 let attr = s:screen_attr(1, [1, 6])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
159 call assert_notequal(attr[0], attr[1])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
160 call assert_notequal(attr[1], attr[3])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
161 call assert_notequal(attr[3], attr[5])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
162 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
163 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
164
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
165 func Test_visual_block_and_selection_exclusive()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
166 call s:test_windows('setl selection=exclusive')
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
167 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
168 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
169 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
170 let expect = [
30693
a59a8ce13129 patch 9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Bram Moolenaar <Bram@vim.org>
parents: 30630
diff changeset
171 \ "+foobar foobar ",
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
172 \ "+foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
173 \ "+foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
174 \ "+foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
175 \ "+foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
176 \ "+foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
177 \ "+foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
178 \ "+foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
179 \ "+foobar foobar ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
180 \ "+foobar TARGETÃx' ",
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 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
183 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
184 endfunc
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
185
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
186 func Test_multibyte_sign_and_colorcolumn()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
187 call s:test_windows("setl nolinebreak cc=3 list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
188 call setline(1, ["", "a b c", "a b c"])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
189 exe "sign define foo text=\uff0b"
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
190 exe "sign place 1 name=foo line=2 buffer=" . bufnr('%')
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
191 redraw!
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
192 norm! ggj0
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
193 let signwidth = strdisplaywidth("\uff0b")
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
194 let attr1 = s:screen_attr(2, [1, 3], signwidth)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
195 let attr2 = s:screen_attr(3, [1, 3], signwidth)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
196 call assert_equal(attr1[0], attr2[0])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
197 call assert_equal(attr1[1], attr2[1])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
198 call assert_equal(attr1[2], attr2[2])
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
199 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
200 let expect = [
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
201 \ " ¶ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
202 \ "+a b c¶ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
203 \ " a b c¶ ",
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
204 \ ]
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
205 call s:compare_lines(expect, lines)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
206 call s:close_windows()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
207 endfunc
10982
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
208
11585
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
209 func Test_colorcolumn_priority()
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
210 call s:test_windows('setl cc=4 cuc hls')
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
211 call setline(1, ["xxyy", ""])
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
212 norm! gg
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
213 exe "normal! /xxyy\<CR>"
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
214 norm! G
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
215 redraw!
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
216 let line_attr = s:screen_attr(1, [1, &cc])
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
217 " Search wins over CursorColumn
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
218 call assert_equal(line_attr[1], line_attr[0])
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
219 " Search wins over Colorcolumn
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
220 call assert_equal(line_attr[2], line_attr[3])
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
221 call s:close_windows('setl hls&vim')
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
222 endfunc
18373179040e patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
223
10982
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
224 func Test_illegal_byte_and_breakat()
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
225 call s:test_windows("setl sbr= brk+=<")
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
226 vert resize 18
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
227 call setline(1, repeat("\x80", 6))
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
228 redraw!
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
229 let lines = s:screen_lines([1, 2], winwidth(0))
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
230 let expect = [
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
231 \ "<80><80><80><80><8",
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
232 \ "0><80> ",
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
233 \ ]
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
234 call s:compare_lines(expect, lines)
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
235 call s:close_windows('setl brk&vim')
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
236 endfunc
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
237
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
238 func Test_multibyte_wrap_and_breakat()
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
239 call s:test_windows("setl sbr= brk+=>")
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
240 call setline(1, repeat('a', 17) . repeat('あ', 2))
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
241 redraw!
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
242 let lines = s:screen_lines([1, 2], winwidth(0))
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
243 let expect = [
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
244 \ "aaaaaaaaaaaaaaaaaあ>",
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
245 \ "あ ",
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
246 \ ]
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
247 call s:compare_lines(expect, lines)
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
248 call s:close_windows('setl brk&vim')
5e20c9f96cd5 patch 8.0.0380: with 'linebreak' double wide char wraps badly
Christian Brabandt <cb@256bit.org>
parents: 10843
diff changeset
249 endfunc
11010
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
250
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
251 func Test_chinese_char_on_wrap_column()
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
252 call s:test_windows("setl nolbr wrap sbr=")
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
253 call setline(1, [
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
254 \ 'aaaaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
255 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
256 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
257 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
258 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
259 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
260 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
261 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
262 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
263 \ 'aaaaaaaaaaaaaaaaa中'.
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
264 \ 'hello'])
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
265 call cursor(1,1)
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
266 norm! $
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
267 redraw!
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
268 let expect=[
30630
218363931f5d patch 9.0.0650: some tests are failing
Bram Moolenaar <Bram@vim.org>
parents: 25749
diff changeset
269 \ '<<<aaaaaaaaaaaaaaaa>',
11010
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
270 \ '中aaaaaaaaaaaaaaaaa>',
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
271 \ '中aaaaaaaaaaaaaaaaa>',
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
272 \ '中aaaaaaaaaaaaaaaaa>',
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
273 \ '中aaaaaaaaaaaaaaaaa>',
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
274 \ '中aaaaaaaaaaaaaaaaa>',
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
275 \ '中aaaaaaaaaaaaaaaaa>',
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
276 \ '中aaaaaaaaaaaaaaaaa>',
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
277 \ '中aaaaaaaaaaaaaaaaa>',
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
278 \ '中hello ']
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
279 let lines = s:screen_lines([1, 10], winwidth(0))
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
280 call s:compare_lines(expect, lines)
32971
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
281 call assert_equal(len(expect), winline())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
282 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
283 call s:close_windows()
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
284 endfunc
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
285
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
286 func Test_chinese_char_on_wrap_column_sbr()
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
287 call s:test_windows("setl nolbr wrap sbr=!!!")
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
288 call setline(1, [
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
289 \ 'aaaaaaaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
290 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
291 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
292 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
293 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
294 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
295 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
296 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
297 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
298 \ 'aaaaaaaaaaaaaa中'.
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
299 \ 'hello'])
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
300 call cursor(1,1)
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
301 norm! $
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
302 redraw!
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
303 let expect=[
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
304 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
305 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
306 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
307 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
308 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
309 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
310 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
311 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
312 \ '!!!中aaaaaaaaaaaaaa>',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
313 \ '!!!中hello ']
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
314 let lines = s:screen_lines([1, 10], winwidth(0))
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
315 call s:compare_lines(expect, lines)
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
316 call assert_equal(len(expect), winline())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
317 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
318 call s:close_windows()
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
319 endfunc
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
320
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
321 func Test_unprintable_char_on_wrap_column()
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
322 call s:test_windows("setl nolbr wrap sbr=")
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
323 call setline(1, 'aaa' .. repeat("\uFEFF", 50) .. 'bbb')
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
324 call cursor(1,1)
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
325 norm! $
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
326 redraw!
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
327 let expect=[
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
328 \ '<<<<feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
329 \ '><feff><feff><feff><',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
330 \ 'feff><feff><feff><fe',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
331 \ 'ff><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
332 \ '><feff><feff><feff><',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
333 \ 'feff><feff><feff><fe',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
334 \ 'ff><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
335 \ '><feff><feff><feff><',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
336 \ 'feff><feff><feff><fe',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
337 \ 'ff>bbb ']
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
338 let lines = s:screen_lines([1, 10], winwidth(0))
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
339 call s:compare_lines(expect, lines)
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
340 call assert_equal(len(expect), winline())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
341 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
342 setl sbr=!!
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
343 redraw!
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
344 let expect=[
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
345 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
346 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
347 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
348 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
349 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
350 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
351 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
352 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
353 \ '!!><feff><feff><feff',
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
354 \ '!!><feff><feff>bbb ']
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
355 let lines = s:screen_lines([1, 10], winwidth(0))
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
356 call s:compare_lines(expect, lines)
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
357 call assert_equal(len(expect), winline())
ccfca4f03a2b Some more missing changes :(
Christian Brabandt <cb@256bit.org>
parents: 30693
diff changeset
358 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
11010
c004e17fa36b patch 8.0.0394: tabs are not aligned when scrolling horizontally
Christian Brabandt <cb@256bit.org>
parents: 10982
diff changeset
359 call s:close_windows()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
360 endfunc
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
361
34298
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
362 " Test that Visual selection is drawn correctly when 'linebreak' is set and
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
363 " selection ends before multibyte 'showbreak'.
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
364 func Test_visual_ends_before_showbreak()
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
365 CheckScreendump
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
366
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
367 let lines =<< trim END
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
368 vim9script
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
369 &wrap = true
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
370 &linebreak = true
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
371 &showbreak = '↪ '
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
372 ['xxxxx ' .. 'y'->repeat(&columns - 6) .. ' zzzz']->setline(1)
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
373 normal! wvel
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
374 END
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
375 call writefile(lines, 'XvisualEndsBeforeShowbreak', 'D')
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
376 let buf = RunVimInTerminal('-S XvisualEndsBeforeShowbreak', #{rows: 6})
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
377 call VerifyScreenDump(buf, 'Test_visual_ends_before_showbreak', {})
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
378
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
379 call StopVimInTerminal(buf)
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
380 endfunc
5525b635ed4a patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Christian Brabandt <cb@256bit.org>
parents: 32971
diff changeset
381
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
382 " vim: shiftwidth=2 sts=2 expandtab