mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 03:28:33 +00:00
vim-patch:8.2.4520: using wrong highlight for cursor line number
Problem: Using wrong highlight for cursor line number.
Solution: Take filler lines into account when using CursorLineNr.
(closes vim/vim#9897)
127969cf98
This commit is contained in:
@@ -2890,9 +2890,9 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
|
|||||||
} else if (wp->w_p_cul
|
} else if (wp->w_p_cul
|
||||||
&& lnum == wp->w_cursor.lnum
|
&& lnum == wp->w_cursor.lnum
|
||||||
&& (wp->w_p_culopt_flags & CULOPT_NBR)
|
&& (wp->w_p_culopt_flags & CULOPT_NBR)
|
||||||
&& (row == startrow
|
&& (row == startrow + filler_lines
|
||||||
|| wp->w_p_culopt_flags & CULOPT_LINE)
|
|| (row > startrow + filler_lines
|
||||||
&& filler_todo == 0) {
|
&& wp->w_p_culopt_flags & CULOPT_LINE))) {
|
||||||
// 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.
|
||||||
// When 'cursorlineopt' has "screenline" only highlight
|
// When 'cursorlineopt' has "screenline" only highlight
|
||||||
|
@@ -1017,6 +1017,32 @@ func Test_diff_with_cursorline()
|
|||||||
call delete('Xtest_diff_cursorline')
|
call delete('Xtest_diff_cursorline')
|
||||||
endfunc
|
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()
|
func Test_diff_with_cursorline_breakindent()
|
||||||
CheckScreendump
|
CheckScreendump
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user