mirror of
https://github.com/vim/vim.git
synced 2025-10-25 09:04:09 -04:00
patch 8.0.0571: negative line number when using :z^ in an empty buffer
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user