Mercurial > vim
annotate src/testdir/test_listlbr_utf8.in @ 8255:355652348057 v7.4.1420
commit https://github.com/vim/vim/commit/d2227a02b03708eb0579e17612d5a96262f3d463
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 25 22:37:42 2016 +0100
patch 7.4.1420
Problem: Missing makefile.
Solution: Type the path correctly.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 25 Feb 2016 22:45:05 +0100 |
parents | 6170f4945b83 |
children |
rev | line source |
---|---|
6062 | 1 Test for linebreak and list option in utf-8 mode |
2 | |
3 STARTTEST | |
4 :so small.vim | |
7287
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
5 :if !exists("+linebreak") || !has("conceal") || !has("signs") | e! test.ok | w! test.out | qa! | endif |
6062 | 6 :so mbyte.vim |
7316
6170f4945b83
commit https://github.com/vim/vim/commit/1c57fe8b9450eb29c3e42a94527d4b7514f853e2
Christian Brabandt <cb@256bit.org>
parents:
7287
diff
changeset
|
7 :set encoding=utf8 |
6062 | 8 :if &enc !=? 'utf-8'|:e! test.ok|:w! test.out|qa!|endif |
9 :10new|:vsp|:vert resize 20 | |
10 :put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \" | |
11 :norm! zt | |
12 :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap | |
6520 | 13 :fu! ScreenChar(width, lines) |
6062 | 14 : let c='' |
6520 | 15 : for j in range(1,a:lines) |
6062 | 16 : for i in range(1,a:width) |
17 : let c.=nr2char(screenchar(j, i)) | |
18 : endfor | |
19 : let c.="\n" | |
20 : endfor | |
21 : return c | |
22 :endfu | |
23 :fu! DoRecordScreen() | |
24 : wincmd l | |
25 : $put =printf(\"\n%s\", g:test) | |
26 : $put =g:line | |
27 : wincmd p | |
28 :endfu | |
7287
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
29 :" |
6062 | 30 :let g:test ="Test 1: set linebreak + set list + fancy listchars" |
31 :exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6" | |
32 :redraw! | |
6520 | 33 :let line=ScreenChar(winwidth(0),4) |
6062 | 34 :call DoRecordScreen() |
6100 | 35 :" |
6062 | 36 :let g:test ="Test 2: set nolinebreak list" |
37 :set list nolinebreak | |
38 :redraw! | |
6520 | 39 :let line=ScreenChar(winwidth(0),4) |
6062 | 40 :call DoRecordScreen() |
6100 | 41 :" |
42 :let g:test ="Test 3: set linebreak nolist" | |
43 :$put =\"\t*mask = nil;\" | |
44 :$ | |
45 :norm! zt | |
46 :set nolist linebreak | |
47 :redraw! | |
6520 | 48 :let line=ScreenChar(winwidth(0),4) |
6100 | 49 :call DoRecordScreen() |
7287
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
50 :" |
6520 | 51 :let g:test ="Test 4: set linebreak list listchars and concealing" |
52 :let c_defines=['#define ABCDE 1','#define ABCDEF 1','#define ABCDEFG 1','#define ABCDEFGH 1', '#define MSG_MODE_FILE 1','#define MSG_MODE_CONSOLE 2','#define MSG_MODE_FILE_AND_CONSOLE 3','#define MSG_MODE_FILE_THEN_CONSOLE 4'] | |
53 :call append('$', c_defines) | |
54 :vert resize 40 | |
55 :$-7 | |
56 :norm! zt | |
57 :set list linebreak listchars=tab:>- cole=1 | |
58 :syn match Conceal conceal cchar=>'AB\|MSG_MODE' | |
59 :redraw! | |
60 :let line=ScreenChar(winwidth(0),7) | |
61 :call DoRecordScreen() | |
7287
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
62 :" |
6627 | 63 :let g:test ="Test 5: set linebreak list listchars and concealing part2" |
64 :let c_defines=['bbeeeeee ; some text'] | |
65 :call append('$', c_defines) | |
66 :$ | |
67 :norm! zt | |
68 :set nowrap ts=2 list linebreak listchars=tab:>- cole=2 concealcursor=n | |
69 :syn clear | |
70 :syn match meaning /;\s*\zs.*/ | |
71 :syn match hasword /^\x\{8}/ contains=word | |
72 :syn match word /\<\x\{8}\>/ contains=beginword,endword contained | |
73 :syn match beginword /\<\x\x/ contained conceal | |
74 :syn match endword /\x\{6}\>/ contained | |
75 :hi meaning guibg=blue | |
76 :hi beginword guibg=green | |
77 :hi endword guibg=red | |
78 :redraw! | |
79 :let line=ScreenChar(winwidth(0),1) | |
80 :call DoRecordScreen() | |
7287
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
81 :" |
6627 | 82 :let g:test ="Test 6: Screenattributes for comment" |
83 :$put =g:test | |
84 :call append('$', ' /* and some more */') | |
85 :exe "set ft=c ts=7 linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6" | |
86 :syntax on | |
87 :hi SpecialKey term=underline ctermfg=red guifg=red | |
88 :let attr=[] | |
89 :nnoremap <expr> GG ":let attr += ['".screenattr(screenrow(),screencol())."']\n" | |
90 :$ | |
91 :norm! zt0 | |
92 GGlGGlGGlGGlGGlGGlGGlGGlGGlGGl | |
93 :call append('$', ['ScreenAttributes for test6:']) | |
94 :if attr[0] != attr[1] && attr[1] != attr[3] && attr[3] != attr[5] | |
95 : call append('$', "Attribut 0 and 1 and 3 and 5 are different!") | |
96 :else | |
97 : call append('$', "Not all attributes are different") | |
98 :endif | |
6866 | 99 :set cpo&vim linebreak selection=exclusive |
7287
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
100 :" |
6866 | 101 :let g:test ="Test 8: set linebreak with visual block mode and v_b_A and selection=exclusive and multibyte char" |
102 :$put =g:test | |
103 Golong line: 40afoobar aTARGETÃ' at end | |
104 :exe "norm! $3B\<C-v>eAx\<Esc>" | |
7287
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
105 :" |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
106 :let g:test ="Test 9: a multibyte sign and colorcolumn" |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
107 :let attr=[] |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
108 :let attr2=[] |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
109 :$put ='' |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
110 :$put ='a b c' |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
111 :$put ='a b c' |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
112 :set list nolinebreak cc=3 |
7316
6170f4945b83
commit https://github.com/vim/vim/commit/1c57fe8b9450eb29c3e42a94527d4b7514f853e2
Christian Brabandt <cb@256bit.org>
parents:
7287
diff
changeset
|
113 :sign define foo text=uff0b |
7287
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
114 :sign place 1 name=foo line=50 buffer=2 |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
115 :norm! 2kztj |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
116 :let line1=line('.') |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
117 0GGlGGlGGlGGl |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
118 :let line2=line('.') |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
119 :let attr2=attr |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
120 :let attr=[] |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
121 0GGlGGlGGlGGl |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
122 :redraw! |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
123 :let line=ScreenChar(winwidth(0),3) |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
124 :call DoRecordScreen() |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
125 :" expected: attr[2] is different because of colorcolumn |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
126 :if attr[0] != attr2[0] || attr[1] != attr2[1] || attr[2] != attr2[2] |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
127 : call append('$', "Screen attributes are different!") |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
128 :else |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
129 : call append('$', "Screen attributes are the same!") |
6fcadba9ec7a
commit https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b
Christian Brabandt <cb@256bit.org>
parents:
6866
diff
changeset
|
130 :endif |
6062 | 131 :%w! test.out |
132 :qa! | |
133 ENDTEST | |
134 dummy text |