From: zeertzjq Date: Fri, 21 Feb 2025 18:49:44 +0000 (+0100) Subject: patch 9.1.1130: 'listchars' "precedes" is not drawn on Tabs. X-Git-Tag: v9.1.1130^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13f100e9328b1344fec79806791eb3f5234d4ccc;p=thirdparty%2Fvim.git patch 9.1.1130: 'listchars' "precedes" is not drawn on Tabs. Problem: 'listchars' "precedes" is not drawn on Tabs. Solution: Only draw 'listchars' "precedes" when not skipping over cells. (zeertzjq) fixes: #5927 closes: #16691 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- diff --git a/src/drawline.c b/src/drawline.c index aabf461110..f24e7e036d 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -3727,6 +3727,7 @@ win_line( && wlv.filler_todo <= 0 #endif && wlv.draw_state > WL_NR + && skip_cells <= 0 && c != NUL) { c = wp->w_lcs_chars.prec; diff --git a/src/testdir/dumps/Test_wincolor_lcs.dump b/src/testdir/dumps/Test_wincolor_lcs.dump index 1e146b2318..3cbfc3fb48 100644 --- a/src/testdir/dumps/Test_wincolor_lcs.dump +++ b/src/testdir/dumps/Test_wincolor_lcs.dump @@ -1,5 +1,5 @@ |<+0#4040ff13#ffff4012| +0#0000001&@73 -|-+0#0000e05&@2|>|-@6>s+0#0000001&|o|m|e|.+0#0000e05&|r+0#0000001&|a|n|d|o|m|.+0#0000e05&|*+0#e0e0e08#6c6c6c255|.+0#0000e05#ffff4012|e+0#0000001&|n|o|u|g|h|.+0#0000e05&|l+0#0000001&|o|n|g|.+0#0000e05&|t+0#0000001&|o|.+0#0000e05&|s+0#0000001&|h|o|w|.+0#0000e05&|'+0#0000001&|e|x|t|e|n|d|s|'|.+0#0000e05&|a+0#0000001&|n|d|.+0#0000e05&|'+0#0000001&|p|r|e|c|e|d|e|s|'|.+0#0000e05&|i+0#0000001&|n|c|l|>+0#4040ff13& +|<+0#4040ff13&|-+0#0000e05&@1|>|-@6>s+0#0000001&|o|m|e|.+0#0000e05&|r+0#0000001&|a|n|d|o|m|.+0#0000e05&|*+0#e0e0e08#6c6c6c255|.+0#0000e05#ffff4012|e+0#0000001&|n|o|u|g|h|.+0#0000e05&|l+0#0000001&|o|n|g|.+0#0000e05&|t+0#0000001&|o|.+0#0000e05&|s+0#0000001&|h|o|w|.+0#0000e05&|'+0#0000001&|e|x|t|e|n|d|s|'|.+0#0000e05&|a+0#0000001&|n|d|.+0#0000e05&|'+0#0000001&|p|r|e|c|e|d|e|s|'|.+0#0000e05&|i+0#0000001&|n|c|l|>+0#4040ff13& |<| +0#0000001&@73 |~+0#4040ff13&| @73 |~| @73 diff --git a/src/testdir/test_listchars.vim b/src/testdir/test_listchars.vim index 481540d7ee..8bed38a589 100644 --- a/src/testdir/test_listchars.vim +++ b/src/testdir/test_listchars.vim @@ -677,6 +677,7 @@ func Test_listchars_precedes_with_wide_char() 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)) @@ -688,8 +689,7 @@ func Test_listchars_precedes_with_wide_char() 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(['!456$ '], ScreenLines(1, 10)) call assert_equal(attr, screenattr(1, 1)) normal! zl call assert_equal(['!56$ '], ScreenLines(1, 10)) @@ -701,4 +701,25 @@ func Test_listchars_precedes_with_wide_char() bw! endfunc +func Test_listchars_precedes_with_tab() + new + setlocal nowrap list listchars=eol:$,precedes:!,tab:<-> + call setline(1, "1234\t56") + let expected_line = '1234<-->56$ ' + call assert_equal([expected_line], ScreenLines(1, 12)) + let expected_attrs = mapnew(range(1, 12), 'screenattr(1, v:val)') + let attr = expected_attrs[-2] + + for i in range(8) + normal! zl + let expected_line = '!' .. expected_line[2:] .. ' ' + let expected_attrs = [attr] + expected_attrs[2:] + expected_attrs[-1:] + call assert_equal([expected_line], ScreenLines(1, 12)) + let attrs = mapnew(range(1, 12), 'screenattr(1, v:val)') + call assert_equal(expected_attrs, attrs) + endfor + + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 646905303f..6961a2719a 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 */ +/**/ + 1130, /**/ 1129, /**/