comparison src/testdir/test_listlbr_utf8.vim @ 32971:ccfca4f03a2b

Some more missing changes :(
author Christian Brabandt <cb@256bit.org>
date Wed, 23 Aug 2023 19:56:02 +0200
parents a59a8ce13129
children 5525b635ed4a
comparison
equal deleted inserted replaced
32970:41154ccdb413 32971:ccfca4f03a2b
247 call s:close_windows('setl brk&vim') 247 call s:close_windows('setl brk&vim')
248 endfunc 248 endfunc
249 249
250 func Test_chinese_char_on_wrap_column() 250 func Test_chinese_char_on_wrap_column()
251 call s:test_windows("setl nolbr wrap sbr=") 251 call s:test_windows("setl nolbr wrap sbr=")
252 syntax off
253 call setline(1, [ 252 call setline(1, [
254 \ 'aaaaaaaaaaaaaaaaaaa中'. 253 \ 'aaaaaaaaaaaaaaaaaaa中'.
255 \ 'aaaaaaaaaaaaaaaaa中'. 254 \ 'aaaaaaaaaaaaaaaaa中'.
256 \ 'aaaaaaaaaaaaaaaaa中'. 255 \ 'aaaaaaaaaaaaaaaaa中'.
257 \ 'aaaaaaaaaaaaaaaaa中'. 256 \ 'aaaaaaaaaaaaaaaaa中'.
276 \ '中aaaaaaaaaaaaaaaaa>', 275 \ '中aaaaaaaaaaaaaaaaa>',
277 \ '中aaaaaaaaaaaaaaaaa>', 276 \ '中aaaaaaaaaaaaaaaaa>',
278 \ '中hello '] 277 \ '中hello ']
279 let lines = s:screen_lines([1, 10], winwidth(0)) 278 let lines = s:screen_lines([1, 10], winwidth(0))
280 call s:compare_lines(expect, lines) 279 call s:compare_lines(expect, lines)
280 call assert_equal(len(expect), winline())
281 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
282 call s:close_windows()
283 endfunc
284
285 func Test_chinese_char_on_wrap_column_sbr()
286 call s:test_windows("setl nolbr wrap sbr=!!!")
287 call setline(1, [
288 \ 'aaaaaaaaaaaaaaaaaaa中'.
289 \ 'aaaaaaaaaaaaaa中'.
290 \ 'aaaaaaaaaaaaaa中'.
291 \ 'aaaaaaaaaaaaaa中'.
292 \ 'aaaaaaaaaaaaaa中'.
293 \ 'aaaaaaaaaaaaaa中'.
294 \ 'aaaaaaaaaaaaaa中'.
295 \ 'aaaaaaaaaaaaaa中'.
296 \ 'aaaaaaaaaaaaaa中'.
297 \ 'aaaaaaaaaaaaaa中'.
298 \ 'hello'])
299 call cursor(1,1)
300 norm! $
301 redraw!
302 let expect=[
303 \ '!!!中aaaaaaaaaaaaaa>',
304 \ '!!!中aaaaaaaaaaaaaa>',
305 \ '!!!中aaaaaaaaaaaaaa>',
306 \ '!!!中aaaaaaaaaaaaaa>',
307 \ '!!!中aaaaaaaaaaaaaa>',
308 \ '!!!中aaaaaaaaaaaaaa>',
309 \ '!!!中aaaaaaaaaaaaaa>',
310 \ '!!!中aaaaaaaaaaaaaa>',
311 \ '!!!中aaaaaaaaaaaaaa>',
312 \ '!!!中hello ']
313 let lines = s:screen_lines([1, 10], winwidth(0))
314 call s:compare_lines(expect, lines)
315 call assert_equal(len(expect), winline())
316 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
317 call s:close_windows()
318 endfunc
319
320 func Test_unprintable_char_on_wrap_column()
321 call s:test_windows("setl nolbr wrap sbr=")
322 call setline(1, 'aaa' .. repeat("\uFEFF", 50) .. 'bbb')
323 call cursor(1,1)
324 norm! $
325 redraw!
326 let expect=[
327 \ '<<<<feff><feff><feff',
328 \ '><feff><feff><feff><',
329 \ 'feff><feff><feff><fe',
330 \ 'ff><feff><feff><feff',
331 \ '><feff><feff><feff><',
332 \ 'feff><feff><feff><fe',
333 \ 'ff><feff><feff><feff',
334 \ '><feff><feff><feff><',
335 \ 'feff><feff><feff><fe',
336 \ 'ff>bbb ']
337 let lines = s:screen_lines([1, 10], winwidth(0))
338 call s:compare_lines(expect, lines)
339 call assert_equal(len(expect), winline())
340 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
341 setl sbr=!!
342 redraw!
343 let expect=[
344 \ '!!><feff><feff><feff',
345 \ '!!><feff><feff><feff',
346 \ '!!><feff><feff><feff',
347 \ '!!><feff><feff><feff',
348 \ '!!><feff><feff><feff',
349 \ '!!><feff><feff><feff',
350 \ '!!><feff><feff><feff',
351 \ '!!><feff><feff><feff',
352 \ '!!><feff><feff><feff',
353 \ '!!><feff><feff>bbb ']
354 let lines = s:screen_lines([1, 10], winwidth(0))
355 call s:compare_lines(expect, lines)
356 call assert_equal(len(expect), winline())
357 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
281 call s:close_windows() 358 call s:close_windows()
282 endfunc 359 endfunc
283 360
284 " vim: shiftwidth=2 sts=2 expandtab 361 " vim: shiftwidth=2 sts=2 expandtab