Mercurial > vim
diff src/testdir/test_number.vim @ 34286:7afcc5481eb7 v9.1.0079
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Commit: https://github.com/vim/vim/commit/ebfd856cfdf6ea0b16c8d115000961c998ce97da
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Feb 6 10:59:03 2024 +0100
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Problem: LineNrAbove and LineNrBelow background wrong on wrapped lines.
Solution: Update number column also for wrapped part of a line.
(zeertzjq)
closes: #13974
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 06 Feb 2024 11:15:04 +0100 |
parents | 218363931f5d |
children | 0690fd6f9d48 |
line wrap: on
line diff
--- a/src/testdir/test_number.vim +++ b/src/testdir/test_number.vim @@ -278,9 +278,7 @@ func Test_relativenumber_colors() [CODE] call writefile(lines, 'XTest_relnr', 'D') - " Check that the balloon shows up after a mouse move let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50}) - call TermWait(buf, 50) " Default colors call VerifyScreenDump(buf, 'Test_relnr_colors_1', {}) @@ -297,6 +295,36 @@ func Test_relativenumber_colors() call StopVimInTerminal(buf) endfunc +func Test_relativenumber_colors_wrapped() + CheckScreendump + + let lines =<< trim [CODE] + set display=lastline scrolloff=0 + call setline(1, range(200)->map('v:val->string()->repeat(40)')) + 111 + set number relativenumber + hi LineNr ctermbg=red ctermfg=black + hi LineNrAbove ctermbg=blue ctermfg=black + hi LineNrBelow ctermbg=green ctermfg=black + [CODE] + call writefile(lines, 'XTest_relnr_wrap', 'D') + + let buf = RunVimInTerminal('-S XTest_relnr_wrap', {'rows': 20, 'cols': 50}) + + call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_1', {}) + call term_sendkeys(buf, "k") + call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_2', {}) + call term_sendkeys(buf, "2j") + call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_3', {}) + call term_sendkeys(buf, "2j") + call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_4', {}) + call term_sendkeys(buf, "k") + call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_5', {}) + + " clean up + call StopVimInTerminal(buf) +endfunc + func Test_relativenumber_callback() CheckScreendump CheckFeature timers