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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/dumps/Test_wincolor_lcs.dump b/src/testdir/dumps/Test_wincolor_lcs.dump
index 1e146b2..3cbfc3f 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 481540d..8bed38a 100644
--- a/src/testdir/test_listchars.vim
+++ b/src/testdir/test_listchars.vim
@@ -677,6 +677,7 @@
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 @@
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 @@
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