summaryrefslogtreecommitdiff
path: root/src/testdir/test_normal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-24 22:47:46 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-24 22:47:46 +0200
commit03ac52fc025790c474030ea556cec799400aa046 (patch)
tree9ac7313f93b7630297417251d0a56da6a0044d10 /src/testdir/test_normal.vim
parent053f712ef20d143818aa07275cf1f4fa55afbf85 (diff)
downloadvim-git-03ac52fc025790c474030ea556cec799400aa046.tar.gz
patch 8.1.2072: "gk" moves to start of line instead of upwardsv8.1.2072
Problem: "gk" moves to start of line instead of upwards. Solution: Fix off-by-one error. (Christian Brabandt, closes #4969)
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r--src/testdir/test_normal.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index c6df1834a..dcfa929c8 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -2633,3 +2633,25 @@ fun! Test_normal_gdollar_cmd()
call assert_equal('100 foobar foobar fo', getreg(0))
bw!
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