Patch 8.1.2072
Problem:    "gk" moves to start of line instead of upwards.
Solution:   Fix off-by-one error. (Christian Brabandt, closes #4969)
Files:      src/normal.c, src/testdir/test_normal.vim


*** ../vim-8.1.2071/src/normal.c        2019-09-21 20:46:14.728275744 +0200
--- src/normal.c        2019-09-24 22:44:35.690996099 +0200
***************
*** 3406,3413 ****
        {
        if (dir == BACKWARD)
        {
!           if ((long)curwin->w_curswant >= width2)
!               /* move back within line */
                curwin->w_curswant -= width2;
            else
            {
--- 3406,3413 ----
        {
        if (dir == BACKWARD)
        {
!           if ((long)curwin->w_curswant > width2)
!               // move back within line
                curwin->w_curswant -= width2;
            else
            {
*** ../vim-8.1.2071/src/testdir/test_normal.vim 2019-08-14 21:12:00.977833219 
+0200
--- src/testdir/test_normal.vim 2019-09-24 22:42:54.739490058 +0200
***************
*** 2633,2635 ****
--- 2633,2657 ----
    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
*** ../vim-8.1.2071/src/version.c       2019-09-23 22:17:11.763604665 +0200
--- src/version.c       2019-09-24 22:44:12.715107870 +0200
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     2072,
  /**/

-- 
PRINCE:    He's come to rescue me, father.
LAUNCELOT: (embarrassed) Well, let's not jump to conclusions ...
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201909242048.x8OKmmHt020451%40masaka.moolenaar.net.

Raspunde prin e-mail lui