aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-22 20:56:14 +0800
committerGitHub <noreply@github.com>2023-08-22 20:56:14 +0800
commit63094e00139acdec08b43fb4e659a1db170ba963 (patch)
tree28d1da822d23df285abba70830cbae406e1ff8d9
parent3f1a12b8cc6629e8fc6203f494229557ca46ae57 (diff)
downloadrneovim-63094e00139acdec08b43fb4e659a1db170ba963.tar.gz
rneovim-63094e00139acdec08b43fb4e659a1db170ba963.tar.bz2
rneovim-63094e00139acdec08b43fb4e659a1db170ba963.zip
vim-patch:8.0.0571: negative line number when using :z^ in an empty buffer (#24836)
Problem: The cursor line number becomes negative when using :z^ in an empty buffer. (neovim vim/vim#6557) Solution: Correct the line number. Also reset the column. https://github.com/vim/vim/commit/a364cdb648ae009fa7aa05382f5659335683d349 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--test/old/testdir/test_ex_z.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/old/testdir/test_ex_z.vim b/test/old/testdir/test_ex_z.vim
index 481747ce84..665bcc1d76 100644
--- a/test/old/testdir/test_ex_z.vim
+++ b/test/old/testdir/test_ex_z.vim
@@ -98,7 +98,7 @@ func Test_z_bang()
%bwipe!
endfunc
-func Test_z_bug()
+func Test_z_overflow()
" This used to access invalid memory as a result of an integer overflow
" and freeze vim.
normal ox
@@ -106,3 +106,10 @@ func Test_z_bug()
z777777776666666
')
endfunc
+
+func Test_z_negative_lnum()
+ new
+ z^
+ call assert_equal(1, line('.'))
+ bwipe!
+endfunc