From 127969cf98000a760826ca3a0f3781a8b79522f1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 6 Mar 2022 19:54:13 +0000 Subject: 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 #9897) --- src/testdir/test_diffmode.vim | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/testdir/test_diffmode.vim') diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index c626023b4..a632b19bc 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -1056,6 +1056,32 @@ func Test_diff_with_cursorline() 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 -- cgit v1.2.1