aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_normal.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-09-24 20:01:58 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-01 22:27:43 -0400
commit24c4d4e1258f8ca34eb581550776ef613c27a689 (patch)
treed1a340b9ea63f7db6ffb4da92faf794a5ea2115f /src/nvim/testdir/test_normal.vim
parent0253f0cd929a59e1516359eab9ae84ce39643a7b (diff)
downloadrneovim-24c4d4e1258f8ca34eb581550776ef613c27a689.tar.gz
rneovim-24c4d4e1258f8ca34eb581550776ef613c27a689.tar.bz2
rneovim-24c4d4e1258f8ca34eb581550776ef613c27a689.zip
vim-patch:8.1.2072: "gk" moves to start of line instead of upwards
Problem: "gk" moves to start of line instead of upwards. Solution: Fix off-by-one error. (Christian Brabandt, closes vim/vim#4969) https://github.com/vim/vim/commit/03ac52fc025790c474030ea556cec799400aa046
Diffstat (limited to 'src/nvim/testdir/test_normal.vim')
-rw-r--r--src/nvim/testdir/test_normal.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index 532beb9c39..5ff2cf66c9 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -2617,3 +2617,25 @@ Piece of Java
close!
endfunc
+
+func Test_normal_gk()
+ " needs 80 column new window
+ new
+ vert 80new
+ put =[repeat('x',90)..' {{{1', 'x {{{1']
+ norm! gk
+ " In a 80 column wide terminal the window will be only 78 char
+ " (because Vim will leave space for the other window),
+ " but if the terminal is larger, it will be 80 chars, so verify the
+ " cursor column correctly.
+ call assert_equal(winwidth(0)+1, col('.'))
+ call assert_equal(winwidth(0)+1, virtcol('.'))
+ norm! j
+ call assert_equal(6, col('.'))
+ call assert_equal(6, virtcol('.'))
+ norm! gk
+ call assert_equal(95, col('.'))
+ call assert_equal(95, virtcol('.'))
+ bw!
+ bw!
+endfunc