mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 01:02:09 +00:00
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.
a364cdb648
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -98,7 +98,7 @@ func Test_z_bang()
|
|||||||
%bwipe!
|
%bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_z_bug()
|
func Test_z_overflow()
|
||||||
" This used to access invalid memory as a result of an integer overflow
|
" This used to access invalid memory as a result of an integer overflow
|
||||||
" and freeze vim.
|
" and freeze vim.
|
||||||
normal ox
|
normal ox
|
||||||
@@ -106,3 +106,10 @@ func Test_z_bug()
|
|||||||
z777777776666666
|
z777777776666666
|
||||||
')
|
')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_z_negative_lnum()
|
||||||
|
new
|
||||||
|
z^
|
||||||
|
call assert_equal(1, line('.'))
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
Reference in New Issue
Block a user