]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1083: "above" virtual text breaks cursorlineopt=number v9.1.1183
authorzeertzjq <zeertzjq@outlook.com>
Sat, 8 Mar 2025 15:27:37 +0000 (16:27 +0100)
committerChristian Brabandt <cb@256bit.org>
Sat, 8 Mar 2025 15:27:37 +0000 (16:27 +0100)
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>
src/drawline.c
src/testdir/dumps/Test_prop_above_number_3.dump [new file with mode: 0644]
src/testdir/test_textprop.vim
src/version.c

index f24e7e036d6d1daf94372d3b51478ccaa07d9623..1d65f3b4a9d8e5912f300d5eddf03cdfbeb3c492 100644 (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
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 (file)
index 0000000..56ce662
--- /dev/null
@@ -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| 
index bf561cae35c83946ff47b90779f622e7bbcdc8b1..fe2d2df770c7171447d148b06775725bb1bf6c8e 100644 (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
 
index 671ac25ad7a743c387b4b19674e9c1192c3d42f3..2e6ae1f336102fc009e0801f6b2dedd3505fda3e 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1183,
 /**/
     1182,
 /**/