summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-04-20 21:12:30 +0200
committerBram Moolenaar <Bram@vim.org>2017-04-20 21:12:30 +0200
commita364cdb648ae009fa7aa05382f5659335683d349 (patch)
treedb5a75a4f1ec522dcad792847f8ebe4813e6a355 /src/testdir
parentc03944151fec2d5469746642a949c8fcb5a744a8 (diff)
patch 8.0.0571: negative line number when using :z^ in an empty bufferv8.0.0571
Problem: The cursor line number becomes negative when using :z^ in an empty buffer. (neovim #6557) Solution: Correct the line number. Also reset the column.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_ex_z.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/testdir/test_ex_z.vim b/src/testdir/test_ex_z.vim
index 608a36c490..6e03b0bff9 100644
--- a/src/testdir/test_ex_z.vim
+++ b/src/testdir/test_ex_z.vim
@@ -68,7 +68,7 @@ func Test_z()
bw!
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
@@ -76,3 +76,10 @@ func Test_z_bug()
z777777776666666
')
endfunc
+
+func Test_z_negative_lnum()
+ new
+ z^
+ call assert_equal(1, line('.'))
+ bwipe!
+endfunc