patch 9.1.1130: 'listchars' "precedes" is not drawn on Tabs. Commit: https://github.com/vim/vim/commit/13f100e9328b1344fec79806791eb3f5234d4ccc Author: zeertzjq <zeert...@outlook.com> Date: Fri Feb 21 19:49:44 2025 +0100
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 <zeert...@outlook.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/drawline.c b/src/drawline.c index aabf46111..f24e7e036 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 1e146b231..3cbfc3fb4 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 481540d7e..8bed38a58 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 56") + 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 646905303..6961a2719 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, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1tlYFt-004w9b-GX%40256bit.org.