aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-08 19:07:59 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-02-08 19:20:07 +0800
commit1c2b9e8dd8c3fba1ac8f45aef476d6933c9e7017 (patch)
tree841f1265a6cb61e0bb41c6915cb46af7a2c4e01e /test
parent1f9da3d0835af2cfe937de250c2cde3a59e1677e (diff)
downloadrneovim-1c2b9e8dd8c3fba1ac8f45aef476d6933c9e7017.tar.gz
rneovim-1c2b9e8dd8c3fba1ac8f45aef476d6933c9e7017.tar.bz2
rneovim-1c2b9e8dd8c3fba1ac8f45aef476d6933c9e7017.zip
vim-patch:9.1.0082: Redrawing can be improved when deleting lines with 'cursorline'
Problem: Redrawing can be improved when deleting lines with 'cursorline'. Solution: Use smarter invalidation and adjustment. Remove unnecessary UPD_VALID as it is already set at the top of the loop. Make the test for vim/vim#4862 fail without the fix. (zeertzjq) closes: vim/vim#13986 https://github.com/vim/vim/commit/7ce34c9a947b17a8b5e81e7c2335a63552182d10
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_highlight.vim20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/old/testdir/test_highlight.vim b/test/old/testdir/test_highlight.vim
index f7f4d9832b..bcaa1dac5d 100644
--- a/test/old/testdir/test_highlight.vim
+++ b/test/old/testdir/test_highlight.vim
@@ -541,7 +541,7 @@ func Test_cursorline_after_yank()
call writefile([
\ 'set cul rnu',
\ 'call setline(1, ["","1","2","3",""])',
- \ ], 'Xtest_cursorline_yank')
+ \ ], 'Xtest_cursorline_yank', 'D')
let buf = RunVimInTerminal('-S Xtest_cursorline_yank', {'rows': 8})
call TermWait(buf)
call term_sendkeys(buf, "Gy3k")
@@ -552,25 +552,25 @@ func Test_cursorline_after_yank()
" clean up
call StopVimInTerminal(buf)
- call delete('Xtest_cursorline_yank')
endfunc
-" test for issue https://github.com/vim/vim/issues/4862
+" Test for issue #4862: pasting above 'cursorline' redraws properly.
func Test_put_before_cursorline()
new
only!
- call setline(1, 'A')
+ call setline(1, ['A', 'B', 'C'])
+ call cursor(2, 1)
redraw
- let std_attr = screenattr(1, 1)
+ let std_attr = screenattr(2, 1)
set cursorline
redraw
- let cul_attr = screenattr(1, 1)
+ let cul_attr = screenattr(2, 1)
normal yyP
redraw
- " Line 1 has cursor so it should be highlighted with CursorLine.
- call assert_equal(cul_attr, screenattr(1, 1))
- " And CursorLine highlighting from the second line should be gone.
- call assert_equal(std_attr, screenattr(2, 1))
+ " Line 2 has cursor so it should be highlighted with CursorLine.
+ call assert_equal(cul_attr, screenattr(2, 1))
+ " And CursorLine highlighting from line 3 should be gone.
+ call assert_equal(std_attr, screenattr(3, 1))
set nocursorline
bwipe!
endfunc