@@ -2,7 +2,7 @@ Test for linebreak and list option in utf-8 mode
22
33STARTTEST
44:so small.vim
5- :if !exists("+linebreak") || !has("conceal") | e! test.ok | w! test.out | qa! | endif
5+ :if !exists("+linebreak") || !has("conceal") || !has("signs") | e! test.ok | w! test.out | qa! | endif
66:so mbyte.vim
77:if &enc !=? 'utf-8'|:e! test.ok|:w! test.out|qa!|endif
88:10new|:vsp|:vert resize 20
@@ -25,6 +25,7 @@ STARTTEST
2525: $put =g:line
2626: wincmd p
2727:endfu
28+ :"
2829:let g:test ="Test 1: set linebreak + set list + fancy listchars"
2930:exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6"
3031:redraw!
@@ -45,6 +46,7 @@ STARTTEST
4546:redraw!
4647:let line=ScreenChar(winwidth(0),4)
4748:call DoRecordScreen()
49+ :"
4850:let g:test ="Test 4: set linebreak list listchars and concealing"
4951: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']
5052:call append('$', c_defines)
@@ -56,6 +58,7 @@ STARTTEST
5658:redraw!
5759:let line=ScreenChar(winwidth(0),7)
5860:call DoRecordScreen()
61+ :"
5962:let g:test ="Test 5: set linebreak list listchars and concealing part2"
6063:let c_defines=['bbeeeeee ; some text']
6164:call append('$', c_defines)
@@ -74,6 +77,7 @@ STARTTEST
7477:redraw!
7578:let line=ScreenChar(winwidth(0),1)
7679:call DoRecordScreen()
80+ :"
7781:let g:test ="Test 6: Screenattributes for comment"
7882:$put =g:test
7983:call append('$', ' /* and some more */')
@@ -92,10 +96,39 @@ GGlGGlGGlGGlGGlGGlGGlGGlGGlGGl
9296: call append('$', "Not all attributes are different")
9397:endif
9498:set cpo&vim linebreak selection=exclusive
99+ :"
95100:let g:test ="Test 8: set linebreak with visual block mode and v_b_A and selection=exclusive and multibyte char"
96101:$put =g:test
97102Golong line: 40afoobar aTARGETÃ' at end
98103:exe "norm! $3B\<C-v>eAx\<Esc>"
104+ :"
105+ :let g:test ="Test 9: a multibyte sign and colorcolumn"
106+ :let attr=[]
107+ :let attr2=[]
108+ :$put =''
109+ :$put ='a b c'
110+ :$put ='a b c'
111+ :set list nolinebreak cc=3
112+ :sign define foo text=ï¼
113+ :sign place 1 name=foo line=50 buffer=2
114+ :norm! 2kztj
115+ :let line1=line('.')
116+ 0GGlGGlGGlGGl
117+ :let line2=line('.')
118+ :let attr2=attr
119+ :let attr=[]
120+ 0GGlGGlGGlGGl
121+ :redraw!
122+ :let line=ScreenChar(winwidth(0),3)
123+ :call DoRecordScreen()
124+ :call append('$', ['ScreenAttributes for test9:'])
125+ :call append('$', ["Line: ".line1. " ". string(g:attr),"Line: ".line2. " ". string(g:attr2)])
126+ :" expected: attr[2] is different because of colorcolumn
127+ :if attr[0] != attr2[0] || attr[1] != attr2[1] || attr[2] != attr2[2]
128+ : call append('$', "Screen attributes are different!")
129+ :else
130+ : call append('$', "Screen attributes are the same!")
131+ :endif
99132:%w! test.out
100133:qa!
101134ENDTEST
0 commit comments