Mercurial > vim
comparison src/testdir/test_listlbr_utf8.vim @ 34298:5525b635ed4a v9.1.0084
patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Commit: https://github.com/vim/vim/commit/df23d7f4bd7546f3152ea003856525591218565b
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri Feb 9 18:14:12 2024 +0100
patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'
Problem: Visual hl wrong when it ends before multibyte 'showbreak'.
(lacygoil)
Solution: Use vcol_sbr instead of adding n_extra.
(zeertzjq)
fixes: #11272
closes: #13996
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 09 Feb 2024 18:30:04 +0100 |
parents | ccfca4f03a2b |
children |
comparison
equal
deleted
inserted
replaced
34297:3f25e021af49 | 34298:5525b635ed4a |
---|---|
7 CheckOption linebreak | 7 CheckOption linebreak |
8 CheckFeature conceal | 8 CheckFeature conceal |
9 CheckFeature signs | 9 CheckFeature signs |
10 | 10 |
11 source view_util.vim | 11 source view_util.vim |
12 source screendump.vim | |
12 | 13 |
13 func s:screen_lines(lnum, width) abort | 14 func s:screen_lines(lnum, width) abort |
14 return ScreenLines(a:lnum, a:width) | 15 return ScreenLines(a:lnum, a:width) |
15 endfunc | 16 endfunc |
16 | 17 |
356 call assert_equal(len(expect), winline()) | 357 call assert_equal(len(expect), winline()) |
357 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol()) | 358 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol()) |
358 call s:close_windows() | 359 call s:close_windows() |
359 endfunc | 360 endfunc |
360 | 361 |
362 " Test that Visual selection is drawn correctly when 'linebreak' is set and | |
363 " selection ends before multibyte 'showbreak'. | |
364 func Test_visual_ends_before_showbreak() | |
365 CheckScreendump | |
366 | |
367 let lines =<< trim END | |
368 vim9script | |
369 &wrap = true | |
370 &linebreak = true | |
371 &showbreak = '↪ ' | |
372 ['xxxxx ' .. 'y'->repeat(&columns - 6) .. ' zzzz']->setline(1) | |
373 normal! wvel | |
374 END | |
375 call writefile(lines, 'XvisualEndsBeforeShowbreak', 'D') | |
376 let buf = RunVimInTerminal('-S XvisualEndsBeforeShowbreak', #{rows: 6}) | |
377 call VerifyScreenDump(buf, 'Test_visual_ends_before_showbreak', {}) | |
378 | |
379 call StopVimInTerminal(buf) | |
380 endfunc | |
381 | |
361 " vim: shiftwidth=2 sts=2 expandtab | 382 " vim: shiftwidth=2 sts=2 expandtab |