mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 08:28:34 +00:00
Merge pull request #14190 from teto/fix-cursorlinenr
fix CursorLineNr with diff
This commit is contained in:
@@ -2758,7 +2758,8 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
|
|||||||
// :sign defined with "numhl" highlight.
|
// :sign defined with "numhl" highlight.
|
||||||
char_attr = sign_get_attr(num_sign, SIGN_NUMHL);
|
char_attr = sign_get_attr(num_sign, SIGN_NUMHL);
|
||||||
} else if ((wp->w_p_cul || wp->w_p_rnu)
|
} else if ((wp->w_p_cul || wp->w_p_rnu)
|
||||||
&& lnum == wp->w_cursor.lnum) {
|
&& lnum == wp->w_cursor.lnum
|
||||||
|
&& filler_todo == 0) {
|
||||||
// When 'cursorline' is set highlight the line number of
|
// When 'cursorline' is set highlight the line number of
|
||||||
// the current line differently.
|
// the current line differently.
|
||||||
// TODO(vim): Can we use CursorLine instead of CursorLineNr
|
// TODO(vim): Can we use CursorLine instead of CursorLineNr
|
||||||
|
@@ -1049,6 +1049,8 @@ it('diff updates line numbers below filler lines', function()
|
|||||||
[9] = {background = Screen.colors.LightMagenta},
|
[9] = {background = Screen.colors.LightMagenta},
|
||||||
[10] = {bold = true, foreground = Screen.colors.Brown},
|
[10] = {bold = true, foreground = Screen.colors.Brown},
|
||||||
[11] = {foreground = Screen.colors.Brown},
|
[11] = {foreground = Screen.colors.Brown},
|
||||||
|
[12] = {foreground = Screen.colors.Brown, bold = true, background = Screen.colors.Red};
|
||||||
|
[13] = {background = Screen.colors.Gray90};
|
||||||
})
|
})
|
||||||
source([[
|
source([[
|
||||||
call setline(1, ['a', 'a', 'a', 'y', 'b', 'b', 'b', 'b', 'b'])
|
call setline(1, ['a', 'a', 'a', 'y', 'b', 'b', 'b', 'b', 'b'])
|
||||||
@@ -1107,4 +1109,22 @@ it('diff updates line numbers below filler lines', function()
|
|||||||
{3:[No Name] [+] }{7:[No Name] [+] }|
|
{3:[No Name] [+] }{7:[No Name] [+] }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
|
command("set signcolumn number tgc cursorline")
|
||||||
|
command("hi CursorLineNr guibg=red")
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1: }a {3:│}{11: 2 }a |
|
||||||
|
{1: }a {3:│}{11: 1 }a |
|
||||||
|
{1: }a {3:│}{12:3 }{13:^a }|
|
||||||
|
{1: }{8:x}{9: }{3:│}{11: 1 }{8:y}{9: }|
|
||||||
|
{1: }{4:x }{3:│}{11: }{2:----------------}|
|
||||||
|
{1: }{4:x }{3:│}{11: }{2:----------------}|
|
||||||
|
{1: }b {3:│}{11: 2 }b |
|
||||||
|
{1: }b {3:│}{11: 3 }b |
|
||||||
|
{1: }b {3:│}{11: 4 }b |
|
||||||
|
{1: }b {3:│}{11: 5 }b |
|
||||||
|
{1: }b {3:│}{11: 6 }b |
|
||||||
|
{6:~ }{3:│}{6:~ }|
|
||||||
|
{3:[No Name] [+] }{7:[No Name] [+] }|
|
||||||
|
signcolumn=auto |
|
||||||
|
]]}
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user