comparison src/testdir/test_normal.vim @ 18154:5e10ee16f4b4 v8.1.2072

patch 8.1.2072: "gk" moves to start of line instead of upwards Commit: https://github.com/vim/vim/commit/03ac52fc025790c474030ea556cec799400aa046 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 24 22:47:46 2019 +0200 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 https://github.com/vim/vim/issues/4969)
author Bram Moolenaar <Bram@vim.org>
date Tue, 24 Sep 2019 23:00:05 +0200
parents 131f1d8c5860
children 11f68eb58fda
comparison
equal deleted inserted replaced
18153:15be611fcb05 18154:5e10ee16f4b4
2631 norm! 0v6g$y 2631 norm! 0v6g$y
2632 call assert_equal(20, col("'>")) 2632 call assert_equal(20, col("'>"))
2633 call assert_equal('100 foobar foobar fo', getreg(0)) 2633 call assert_equal('100 foobar foobar fo', getreg(0))
2634 bw! 2634 bw!
2635 endfunc 2635 endfunc
2636
2637 func Test_normal_gk()
2638 " needs 80 column new window
2639 new
2640 vert 80new
2641 put =[repeat('x',90)..' {{{1', 'x {{{1']
2642 norm! gk
2643 " In a 80 column wide terminal the window will be only 78 char
2644 " (because Vim will leave space for the other window),
2645 " but if the terminal is larger, it will be 80 chars, so verify the
2646 " cursor column correctly.
2647 call assert_equal(winwidth(0)+1, col('.'))
2648 call assert_equal(winwidth(0)+1, virtcol('.'))
2649 norm! j
2650 call assert_equal(6, col('.'))
2651 call assert_equal(6, virtcol('.'))
2652 norm! gk
2653 call assert_equal(95, col('.'))
2654 call assert_equal(95, virtcol('.'))
2655 bw!
2656 bw!
2657 endfunc