patch 9.1.1083: "above" virtual text breaks cursorlineopt=number

Problem:  "above" virtual text breaks cursorlineopt=number.
Solution: Take "above" virtual text into account when applying
          CursorLineNr highlight.

fixes: #16828
closes: #16829

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-03-08 16:27:37 +01:00
committed by Christian Brabandt
parent 62e822808e
commit 62f19541f4
4 changed files with 16 additions and 2 deletions

View File

@ -461,8 +461,8 @@ handle_lnum_col(
if (wp->w_p_cul
&& wlv->lnum == wp->w_cursor.lnum
&& (wp->w_p_culopt_flags & CULOPT_NBR)
&& (wlv->row == wlv->startrow + wlv->filler_lines
|| (wlv->row > wlv->startrow + wlv->filler_lines
&& (wlv->row == lnum_row
|| (wlv->row > lnum_row
&& (wp->w_p_culopt_flags & CULOPT_LINE))))
wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_CLN));
#endif

View File

@ -0,0 +1,8 @@
| +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|e| |o|n|e| |o|n|e| @59
| +0#af5f00255&@3|a+0#0000000#ffd7ff255|b|o|v|e| |t|h|e| |t|e|x|t| +0&#ffffff0@56
| +0#af5f00255&@3|a+0#0000000#ffd7ff255|l|s|o| |a|b|o|v|e| |t|h|e| |t|e|x|t| +0&#ffffff0@47> @3
| +8#af5f00255&@1|2| |t+0#0000000&|w|o| |t|w|o| |t|w|o| @59
| +0#af5f00255&@1|3| |t+0#0000000&|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| @53
|~+0#4040ff13&| @73
|~| @73
|:+0#0000000&|s|e|t|l|o|c|a|l| |c|u|r|s|o|r|l|i|n|e| |c|u|r|s|o|r|l|i|n|e|o|p|t|=|n|u|m|b|e|r| @15|2|,|1|-|1|4|3| @6|A|l@1|

View File

@ -3695,6 +3695,10 @@ func Test_prop_above_with_number()
call term_sendkeys(buf, ":call OneMore()\<CR>")
call VerifyScreenDump(buf, 'Test_prop_above_number_2', {})
call term_sendkeys(buf, ":setlocal cursorline cursorlineopt=number\<CR>")
call term_sendkeys(buf, 'j')
call VerifyScreenDump(buf, 'Test_prop_above_number_3', {})
call StopVimInTerminal(buf)
endfunc

View File

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