From: zeertzjq Date: Thu, 20 Feb 2025 21:04:09 +0000 (+0100) Subject: patch 9.1.1124: No test for 'listchars' "precedes" with double-width char X-Git-Tag: v9.1.1124^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08a83a033a32c0f5bc42eaa63162c21c369cb4ae;p=thirdparty%2Fvim.git patch 9.1.1124: No test for 'listchars' "precedes" with double-width char Problem: No test for 'listchars' "precedes" with double-width char. Solution: Add a test and fix a typo in code (zeertzjq). closes: #16675 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- diff --git a/src/drawline.c b/src/drawline.c index f0a7a92a99..aabf461110 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -3718,7 +3718,7 @@ win_line( #endif // Handle the case where we are in column 0 but not on the first // character of the line and the user wants us to show us a - // special character (via 'listchars' option "precedes:". + // special character (via 'listchars' option "precedes:"). if (lcs_prec_todo != NUL && wp->w_p_list && (wp->w_p_wrap ? (wp->w_skipcol > 0 && wlv.row == 0) diff --git a/src/testdir/test_listchars.vim b/src/testdir/test_listchars.vim index 46e96de02b..481540d7ee 100644 --- a/src/testdir/test_listchars.vim +++ b/src/testdir/test_listchars.vim @@ -671,5 +671,34 @@ func Test_listchars_foldcolumn() call StopVimInTerminal(buf) endfunc +func Test_listchars_precedes_with_wide_char() + new + setlocal nowrap list listchars=eol:$,precedes:! + call setline(1, '123口456') + call assert_equal(['123口456$ '], ScreenLines(1, 10)) + let attr = screenattr(1, 9) + normal! zl + call assert_equal(['!3口456$ '], ScreenLines(1, 10)) + call assert_equal(attr, screenattr(1, 1)) + normal! zl + call assert_equal(['!口456$ '], ScreenLines(1, 10)) + call assert_equal(attr, screenattr(1, 1)) + normal! zl + call assert_equal(['!<456$ '], ScreenLines(1, 10)) + call assert_equal(attr, screenattr(1, 1)) + call assert_equal(attr, screenattr(1, 2)) + normal! zl + " TODO: should it be '!' instead of '<' here? + call assert_equal(['<456$ '], ScreenLines(1, 10)) + call assert_equal(attr, screenattr(1, 1)) + normal! zl + call assert_equal(['!56$ '], ScreenLines(1, 10)) + call assert_equal(attr, screenattr(1, 1)) + normal! zl + call assert_equal(['!6$ '], ScreenLines(1, 10)) + call assert_equal(attr, screenattr(1, 1)) + + bw! +endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 0e7e236ea2..33640818fa 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1124, /**/ 1123, /**/