6062
|
1 Test for linebreak and list option in utf-8 mode
|
|
2
|
|
3 STARTTEST
|
|
4 :so small.vim
|
|
5 :if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif
|
|
6 :so mbyte.vim
|
|
7 :if &enc !=? 'utf-8'|:e! test.ok|:w! test.out|qa!|endif
|
|
8 :10new|:vsp|:vert resize 20
|
|
9 :put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \"
|
|
10 :norm! zt
|
|
11 :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
|
6520
|
12 :fu! ScreenChar(width, lines)
|
6062
|
13 : let c=''
|
6520
|
14 : for j in range(1,a:lines)
|
6062
|
15 : for i in range(1,a:width)
|
|
16 : let c.=nr2char(screenchar(j, i))
|
|
17 : endfor
|
|
18 : let c.="\n"
|
|
19 : endfor
|
|
20 : return c
|
|
21 :endfu
|
|
22 :fu! DoRecordScreen()
|
|
23 : wincmd l
|
|
24 : $put =printf(\"\n%s\", g:test)
|
|
25 : $put =g:line
|
|
26 : wincmd p
|
|
27 :endfu
|
|
28 :let g:test ="Test 1: set linebreak + set list + fancy listchars"
|
|
29 :exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6"
|
|
30 :redraw!
|
6520
|
31 :let line=ScreenChar(winwidth(0),4)
|
6062
|
32 :call DoRecordScreen()
|
6100
|
33 :"
|
6062
|
34 :let g:test ="Test 2: set nolinebreak list"
|
|
35 :set list nolinebreak
|
|
36 :redraw!
|
6520
|
37 :let line=ScreenChar(winwidth(0),4)
|
6062
|
38 :call DoRecordScreen()
|
6100
|
39 :"
|
|
40 :let g:test ="Test 3: set linebreak nolist"
|
|
41 :$put =\"\t*mask = nil;\"
|
|
42 :$
|
|
43 :norm! zt
|
|
44 :set nolist linebreak
|
|
45 :redraw!
|
6520
|
46 :let line=ScreenChar(winwidth(0),4)
|
6100
|
47 :call DoRecordScreen()
|
6520
|
48 :let g:test ="Test 4: set linebreak list listchars and concealing"
|
|
49 :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']
|
|
50 :call append('$', c_defines)
|
|
51 :vert resize 40
|
|
52 :$-7
|
|
53 :norm! zt
|
|
54 :set list linebreak listchars=tab:>- cole=1
|
|
55 :syn match Conceal conceal cchar=>'AB\|MSG_MODE'
|
|
56 :redraw!
|
|
57 :let line=ScreenChar(winwidth(0),7)
|
|
58 :call DoRecordScreen()
|
6062
|
59 :%w! test.out
|
|
60 :qa!
|
|
61 ENDTEST
|
|
62 dummy text
|