Patch 8.2.4520
Problem:    Using wrong highlight for cursor line number.
Solution:   Take filler lines into account when using CursorLineNr.
            (closes #9897)
Files:      src/drawline.c, src/testdir/test_diffmode.vim,
            src/testdir/dumps/Test_diff_with_cursorline_number_01.dump,
            src/testdir/dumps/Test_diff_with_cursorline_number_02.dump


*** ../vim-8.2.4519/src/drawline.c      2022-02-25 21:05:31.598434512 +0000
--- src/drawline.c      2022-03-06 19:41:21.364353813 +0000
***************
*** 1194,1201 ****
                      if (wp->w_p_cul
                              && lnum == wp->w_cursor.lnum
                              && (wp->w_p_culopt_flags & CULOPT_NBR)
!                             && (row == startrow
!                                 || wp->w_p_culopt_flags & CULOPT_LINE))
                        char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLN));
  #endif
                      if (wp->w_p_rnu && lnum < wp->w_cursor.lnum
--- 1194,1202 ----
                      if (wp->w_p_cul
                              && lnum == wp->w_cursor.lnum
                              && (wp->w_p_culopt_flags & CULOPT_NBR)
!                             && (row == startrow + filler_lines
!                                 || (row > startrow + filler_lines
!                                     && wp->w_p_culopt_flags & CULOPT_LINE)))
                        char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLN));
  #endif
                      if (wp->w_p_rnu && lnum < wp->w_cursor.lnum
*** ../vim-8.2.4519/src/testdir/test_diffmode.vim       2022-02-10 
19:51:42.545569904 +0000
--- src/testdir/test_diffmode.vim       2022-03-06 19:52:08.399356316 +0000
***************
*** 1056,1061 ****
--- 1056,1087 ----
    call delete('Xtest_diff_cursorline')
  endfunc
  
+ func Test_diff_with_cursorline_number()
+   CheckScreendump
+ 
+   let lines =<< trim END
+       hi CursorLine ctermbg=red ctermfg=white
+       hi CursorLineNr ctermbg=white ctermfg=black cterm=underline
+       set cursorline number
+       call setline(1, ["baz", "foo", "foo", "bar"])
+       2
+       vnew
+       call setline(1, ["foo", "foo", "bar"])
+       windo diffthis
+       1wincmd w
+   END
+   call writefile(lines, 'Xtest_diff_cursorline_number')
+   let buf = RunVimInTerminal('-S Xtest_diff_cursorline_number', {})
+ 
+   call VerifyScreenDump(buf, 'Test_diff_with_cursorline_number_01', {})
+   call term_sendkeys(buf, ":set cursorlineopt=number\r")
+   call VerifyScreenDump(buf, 'Test_diff_with_cursorline_number_02', {})
+ 
+   " clean up
+   call StopVimInTerminal(buf)
+   call delete('Xtest_diff_cursorline_number')
+ endfunc
+ 
  func Test_diff_with_cursorline_breakindent()
    CheckScreendump
  
*** ../vim-8.2.4519/src/testdir/dumps/Test_diff_with_cursorline_number_01.dump  
2022-03-06 19:50:08.719533317 +0000
--- src/testdir/dumps/Test_diff_with_cursorline_number_01.dump  2022-03-06 
19:41:21.364353813 +0000
***************
*** 0 ****
--- 1,20 ----
+ | +0#0000e05#a8a8a8255@1| 
+0#af5f00255#ffffff0@3|-+0#4040ff13#afffff255@30||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|1| |b+0#0000000#5fd7ff255|a|z| 
@27
+ | +0#0000e05#a8a8a8255@1| +8#0000001#ffffff16@1|1| 
>f+8#ffffff16#ff404010|o@1| @27||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| 
+8#0000001#ffffff16@1|2| |f+8#ffffff16#ff404010|o@1| @27
+ | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|2| |f+0#0000000&|o@1| 
@27||+1&&| +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|3| |f+0#0000000&|o@1| 
@27
+ | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|3| |b+0#0000000&|a|r| 
@27||+1&&| +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|4| |b+0#0000000&|a|r| 
@27
+ |~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|A|l@1| |[+1&&|N|o| 
|N|a|m|e|]| |[|+|]| @5|2|,|1| @11|A|l@1
+ | +0&&@74
*** ../vim-8.2.4519/src/testdir/dumps/Test_diff_with_cursorline_number_02.dump  
2022-03-06 19:50:08.727533307 +0000
--- src/testdir/dumps/Test_diff_with_cursorline_number_02.dump  2022-03-06 
19:41:21.364353813 +0000
***************
*** 0 ****
--- 1,20 ----
+ | +0#0000e05#a8a8a8255@1| 
+0#af5f00255#ffffff0@3|-+0#4040ff13#afffff255@30||+1#0000000#ffffff0| 
+0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|1| |b+0#0000000#5fd7ff255|a|z| 
@27
+ | +0#0000e05#a8a8a8255@1| +8#0000001#ffffff16@1|1| >f+0#0000000#ffffff0|o@1| 
@27||+1&&| +0#0000e05#a8a8a8255@1| +8#0000001#ffffff16@1|2| 
|f+8#ffffff16#ff404010|o@1| @27
+ | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|2| |f+0#0000000&|o@1| 
@27||+1&&| +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|3| |f+0#0000000&|o@1| 
@27
+ | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|3| |b+0#0000000&|a|r| 
@27||+1&&| +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|4| |b+0#0000000&|a|r| 
@27
+ |~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |~| @35||+1#0000000&|~+0#4040ff13&| @35
+ |[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|A|l@1| |[+1&&|N|o| 
|N|a|m|e|]| |[|+|]| @5|2|,|1| @11|A|l@1
+ |:+0&&|s|e|t| |c|u|r|s|o|r|l|i|n|e|o|p|t|=|n|u|m|b|e|r| @49
*** ../vim-8.2.4519/src/version.c       2022-03-06 14:51:19.058997629 +0000
--- src/version.c       2022-03-06 19:48:35.647672637 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4520,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
180. You maintain more than six e-mail addresses.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220306195636.102961C042A%40moolenaar.net.

Raspunde prin e-mail lui