6062
|
1 Test for linebreak and list option (non-utf8)
|
6026
|
2
|
|
3 STARTTEST
|
|
4 :so small.vim
|
6266
|
5 :if !exists("+linebreak") || !has("conceal") | e! test.ok | w! test.out | qa! | endif
|
6026
|
6 :10new|:vsp|:vert resize 20
|
6062
|
7 :put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \"
|
6026
|
8 :norm! zt
|
|
9 :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
|
|
10 :fu! ScreenChar(width)
|
|
11 : let c=''
|
|
12 : for j in range(1,4)
|
|
13 : for i in range(1,a:width)
|
|
14 : let c.=nr2char(screenchar(j, i))
|
|
15 : endfor
|
|
16 : let c.="\n"
|
|
17 : endfor
|
|
18 : return c
|
|
19 :endfu
|
|
20 :fu! DoRecordScreen()
|
|
21 : wincmd l
|
|
22 : $put =printf(\"\n%s\", g:test)
|
|
23 : $put =g:line
|
|
24 : wincmd p
|
|
25 :endfu
|
|
26 :let g:test="Test 1: set linebreak"
|
|
27 :redraw!
|
|
28 :let line=ScreenChar(winwidth(0))
|
|
29 :call DoRecordScreen()
|
|
30 :let g:test="Test 2: set linebreak + set list"
|
|
31 :set linebreak list listchars=
|
|
32 :redraw!
|
|
33 :let line=ScreenChar(winwidth(0))
|
|
34 :call DoRecordScreen()
|
6062
|
35 :let g:test ="Test 3: set linebreak nolist"
|
6026
|
36 :set nolist linebreak
|
|
37 :redraw!
|
|
38 :let line=ScreenChar(winwidth(0))
|
|
39 :call DoRecordScreen()
|
6062
|
40 :let g:test ="Test 4: set linebreak with tab and 1 line as long as screen: should break!"
|
6026
|
41 :set nolist linebreak ts=8
|
|
42 :let line="1\t".repeat('a', winwidth(0)-2)
|
|
43 :$put =line
|
|
44 :$
|
|
45 :norm! zt
|
|
46 :redraw!
|
|
47 :let line=ScreenChar(winwidth(0))
|
|
48 :call DoRecordScreen()
|
6172
|
49 :let line="_S_\t bla"
|
|
50 :$put =line
|
|
51 :$
|
|
52 :norm! zt
|
|
53 :let g:test ="Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated)"
|
|
54 :set cpo&vim list linebreak conceallevel=2 concealcursor=nv listchars=tab:ab
|
|
55 :syn match ConcealVar contained /_/ conceal
|
|
56 :syn match All /.*/ contains=ConcealVar
|
|
57 :let line=ScreenChar(winwidth(0))
|
|
58 :call DoRecordScreen()
|
6266
|
59 :set cpo&vim linebreak
|
|
60 :let g:test ="Test 6: set linebreak with visual block mode"
|
|
61 :let line="REMOVE: this not"
|
|
62 :$put =line
|
|
63 :let line="REMOVE: aaaaaaaaaaaaa"
|
|
64 :$put =line
|
|
65 :1/^REMOVE:
|
|
66 0jf x:$put
|
6026
|
67 :%w! test.out
|
|
68 :qa!
|
|
69 ENDTEST
|
|
70 dummy text
|