diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-06-01 19:27:08 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-06-01 19:27:08 +0100 |
commit | 8509014adda188ee8bdf6a2e123fbf15a91b29d2 (patch) | |
tree | 122f7ac29f4939cf2b87916e72b9fcb92475f08c /src/testdir | |
parent | eb43b7f0531bd13d15580b5c262a25d6a52a0823 (diff) |
patch 9.0.1597: cursor ends up below the window after a putv9.0.1597
Problem: Cursor ends up below the window after a put.
Solution: Mark w_crow and w_botline invalid when changing the cursor line.
(closes #12465)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/dumps/Test_put_in_last_displayed_line_1.dump | 10 | ||||
-rw-r--r-- | src/testdir/test_put.vim | 18 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_put_in_last_displayed_line_1.dump b/src/testdir/dumps/Test_put_in_last_displayed_line_1.dump new file mode 100644 index 0000000000..3d094f5522 --- /dev/null +++ b/src/testdir/dumps/Test_put_in_last_displayed_line_1.dump @@ -0,0 +1,10 @@ +|2+0&#ffffff0| @73 +|3| @73 +|4| @73 +|5| @73 +|6| @73 +|7| @73 +|8| @73 +|9|x@73 +@73>x| +@57|1|0|,|1|4|9| @7|B|o|t| diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim index 4b514bb754..72479ac7d4 100644 --- a/src/testdir/test_put.vim +++ b/src/testdir/test_put.vim @@ -262,5 +262,23 @@ func Test_put_other_window() call StopVimInTerminal(buf) endfunc +func Test_put_in_last_displayed_line() + CheckRunVimInTerminal + + let lines =<< trim END + vim9script + autocmd CursorMoved * eval line('w$') + @a = 'x'->repeat(&columns * 2 - 2) + range(&lines)->setline(1) + feedkeys('G"ap') + END + call writefile(lines, 'Xtest_put_last_line', 'D') + let buf = RunVimInTerminal('-S Xtest_put_last_line', #{rows: 10}) + + call VerifyScreenDump(buf, 'Test_put_in_last_displayed_line_1', {}) + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |