1
0
forked from aniani/vim

patch 9.0.0201: CursorLine highlight overrules virtual text highlight

Problem:    CursorLine highlight overrules virtual text highlight.
Solution:   Let extra attribute overrule line attribute. (closes #10909)
This commit is contained in:
Bram Moolenaar
2022-08-13 20:17:34 +01:00
parent 8f369fb1ab
commit 9113c2cd19
5 changed files with 11 additions and 7 deletions

View File

@@ -1638,7 +1638,8 @@ win_line(
& TP_FLAG_ALIGN_BELOW))) & TP_FLAG_ALIGN_BELOW)))
: bcol >= text_props[text_prop_next].tp_col - 1)) : bcol >= text_props[text_prop_next].tp_col - 1))
{ {
if (bcol <= text_props[text_prop_next].tp_col - 1 if (text_props[text_prop_next].tp_col == MAXCOL
|| bcol <= text_props[text_prop_next].tp_col - 1
+ text_props[text_prop_next].tp_len) + text_props[text_prop_next].tp_len)
text_prop_idxs[text_props_active++] = text_prop_next; text_prop_idxs[text_props_active++] = text_prop_next;
++text_prop_next; ++text_prop_next;
@@ -2989,7 +2990,7 @@ win_line(
{ {
#ifdef LINE_ATTR #ifdef LINE_ATTR
if (line_attr) if (line_attr)
wlv.char_attr = hl_combine_attr(extra_attr, line_attr); wlv.char_attr = hl_combine_attr(line_attr, extra_attr);
else else
#endif #endif
wlv.char_attr = extra_attr; wlv.char_attr = extra_attr;

View File

@@ -3,8 +3,8 @@
| +0#0000e05#a8a8a8255@4|t+0#0000000#ffffff0|w|o| @51 | +0#0000e05#a8a8a8255@4|t+0#0000000#ffffff0|w|o| @51
| +0#0000e05#a8a8a8255@4|a+0#0000000#ffff4012|n|o|t|h|e|r| +0&#ffffff0@47 | +0#0000e05#a8a8a8255@4|a+0#0000000#ffff4012|n|o|t|h|e|r| +0&#ffffff0@47
| +0#0000e05#a8a8a8255@4|O+0#ffffff16#e000002|n|e| |M|o|r|e| |H|e|r|e| +0#0000000#ffffff0@41 | +0#0000e05#a8a8a8255@4|O+0#ffffff16#e000002|n|e| |M|o|r|e| |H|e|r|e| +0#0000000#ffffff0@41
| +0#0000e05#a8a8a8255@4|t+0#0000000#ffffff0|h|r|e>e| @36|r+0&#ffff4012|i|g|h|t| |a|l|i|g|n|e|d | +0#0000e05#a8a8a8255@4|t+8#0000000#e0e0e08|h|r|e>e| @36|r+8&#ffff4012|i|g|h|t| |a|l|i|g|n|e|d
| +0#0000e05#a8a8a8255@4| +0#0000000#ffffff0@36|a+0&#ffff4012|l|s|o| |r|i|g|h|t| |a|l|i|g|n|e|d | +0#0000e05#a8a8a8255@4| +8#0000000#e0e0e08@36|a+8&#ffff4012|l|s|o| |r|i|g|h|t| |a|l|i|g|n|e|d
| +0#0000e05#a8a8a8255@4|f+0#0000000#ffffff0|o|u|r| @50 | +0#0000e05#a8a8a8255@4|f+0#0000000#ffffff0|o|u|r| @50
|~+0#4040ff13&| @58 |~+0#4040ff13&| @58
|~| @58 |~| @58

View File

@@ -5,8 +5,8 @@
| +0#0000e05#a8a8a8255@4|O+0#ffffff16#e000002|n|e| |M|o|r|e| |H|e|r|e| +0#0000000#ffffff0@41 | +0#0000e05#a8a8a8255@4|O+0#ffffff16#e000002|n|e| |M|o|r|e| |H|e|r|e| +0#0000000#ffffff0@41
| +0#0000e05#a8a8a8255@4|t+0#0000000#ffffff0|h|r|e@1| @36|r+0&#ffff4012|i|g|h|t| |a|l|i|g|n|e|d | +0#0000e05#a8a8a8255@4|t+0#0000000#ffffff0|h|r|e@1| @36|r+0&#ffff4012|i|g|h|t| |a|l|i|g|n|e|d
| +0#0000e05#a8a8a8255@4| +0#0000000#ffffff0@36|a+0&#ffff4012|l|s|o| |r|i|g|h|t| |a|l|i|g|n|e|d | +0#0000e05#a8a8a8255@4| +0#0000000#ffffff0@36|a+0&#ffff4012|l|s|o| |r|i|g|h|t| |a|l|i|g|n|e|d
| +0#0000e05#a8a8a8255@4|f+0#0000000#ffffff0|o|u>r| @50 | +0#0000e05#a8a8a8255@4|f+8#0000000#e0e0e08|o|u>r| @50
|~+0#4040ff13&| @58 |~+0#4040ff13#ffffff0| @58
|~| @58 |~| @58
|~| @58 |~| @58
| +0#0000000&@41|4|,|4| @10|A|l@1| | +0#0000000&@41|4|,|4| @10|A|l@1|

View File

@@ -2756,12 +2756,13 @@ func Test_props_with_text_after_nowrap()
call prop_add(3, 0, #{type: 'anotherprop', text: 'right aligned', text_align: 'right'}) call prop_add(3, 0, #{type: 'anotherprop', text: 'right aligned', text_align: 'right'})
call prop_add(3, 0, #{type: 'anotherprop', text: 'also right aligned', text_align: 'right'}) call prop_add(3, 0, #{type: 'anotherprop', text: 'also right aligned', text_align: 'right'})
hi CursorLine ctermbg=lightgrey
END END
call writefile(lines, 'XscriptPropsAfterNowrap') call writefile(lines, 'XscriptPropsAfterNowrap')
let buf = RunVimInTerminal('-S XscriptPropsAfterNowrap', #{rows: 12, cols: 60}) let buf = RunVimInTerminal('-S XscriptPropsAfterNowrap', #{rows: 12, cols: 60})
call VerifyScreenDump(buf, 'Test_prop_with_text_after_nowrap_1', {}) call VerifyScreenDump(buf, 'Test_prop_with_text_after_nowrap_1', {})
call term_sendkeys(buf, ":set signcolumn=yes foldcolumn=3\<CR>") call term_sendkeys(buf, ":set signcolumn=yes foldcolumn=3 cursorline\<CR>")
call VerifyScreenDump(buf, 'Test_prop_with_text_after_nowrap_2', {}) call VerifyScreenDump(buf, 'Test_prop_with_text_after_nowrap_2', {})
call term_sendkeys(buf, "j") call term_sendkeys(buf, "j")

View File

@@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
201,
/**/ /**/
200, 200,
/**/ /**/