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>
diff --git a/src/drawline.c b/src/drawline.c
index f24e7e0..1d65f3b 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -461,8 +461,8 @@
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
diff --git a/src/testdir/dumps/Test_prop_above_number_3.dump b/src/testdir/dumps/Test_prop_above_number_3.dump
new file mode 100644
index 0000000..56ce662
--- /dev/null
+++ b/src/testdir/dumps/Test_prop_above_number_3.dump
@@ -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|
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index bf561ca..fe2d2df 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -3695,6 +3695,10 @@
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
diff --git a/src/version.c b/src/version.c
index 671ac25..2e6ae1f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1183,
+/**/
1182,
/**/
1181,