Mercurial > vim
comparison src/testdir/test_ex_z.vim @ 11372:1074f58e1673 v8.0.0571
patch 8.0.0571: negative line number when using :z^ in an empty buffer
commit https://github.com/vim/vim/commit/a364cdb648ae009fa7aa05382f5659335683d349
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 20 21:12:30 2017 +0200
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 https://github.com/vim/vim/issues/6557)
Solution: Correct the line number. Also reset the column.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 20 Apr 2017 21:15:04 +0200 |
parents | ef32a5c74515 |
children | 08940efa6b4e |
comparison
equal
deleted
inserted
replaced
11371:a945e33a8879 | 11372:1074f58e1673 |
---|---|
66 | 66 |
67 set window& scroll& | 67 set window& scroll& |
68 bw! | 68 bw! |
69 endfunc | 69 endfunc |
70 | 70 |
71 func Test_z_bug() | 71 func Test_z_overflow() |
72 " This used to access invalid memory as a result of an integer overflow | 72 " This used to access invalid memory as a result of an integer overflow |
73 " and freeze vim. | 73 " and freeze vim. |
74 normal ox | 74 normal ox |
75 normal Heat | 75 normal Heat |
76 z777777776666666 | 76 z777777776666666 |
77 ') | 77 ') |
78 endfunc | 78 endfunc |
79 | |
80 func Test_z_negative_lnum() | |
81 new | |
82 z^ | |
83 call assert_equal(1, line('.')) | |
84 bwipe! | |
85 endfunc |