]> granicus.if.org Git - vim/commitdiff
patch 8.2.3532: the previous '' mark is restored after moving the cursor v8.2.3532
authorBram Moolenaar <Bram@vim.org>
Sun, 17 Oct 2021 20:53:58 +0000 (21:53 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 17 Oct 2021 20:53:58 +0000 (21:53 +0100)
Problem:    The previous '' mark is restored after moving the cursor to the
            original jump position. (Tony Chen)
Solution:   Forget the previous position after checking. (closes #8985)

src/mark.c
src/testdir/test_marks.vim
src/version.c

index d606763121d6a65393f3df7b3ef882e9fba812ef..c708e07e481ac15d3592a415709d43071899ab68 100644 (file)
@@ -181,10 +181,8 @@ checkpcmark(void)
     if (curwin->w_prev_pcmark.lnum != 0
            && (EQUAL_POS(curwin->w_pcmark, curwin->w_cursor)
                || curwin->w_pcmark.lnum == 0))
-    {
        curwin->w_pcmark = curwin->w_prev_pcmark;
-       curwin->w_prev_pcmark.lnum = 0;         // Show it has been checked
-    }
+    curwin->w_prev_pcmark.lnum = 0;            // it has been checked
 }
 
 #if defined(FEAT_JUMPLIST) || defined(PROTO)
index dcf4904d06bbecead5c80839fec9616743387e2f..12501a3aba070ef96f2543dbc8bc14685dc33820 100644 (file)
@@ -26,6 +26,16 @@ func Test_Incr_Marks()
   enew!
 endfunc
 
+func Test_previous_jump_mark()
+  new
+  call setline(1, ['']->repeat(6))
+  normal Ggg
+  call assert_equal(6, getpos("''")[1])
+  normal jjjjj
+  call assert_equal(6, getpos("''")[1])
+  bwipe!
+endfunc
+
 func Test_setpos()
   new Xone
   let onebuf = bufnr('%')
index fbae0194f81256e2d5033096492f75bdcd19217f..53b902acac627cab808772980907c7f2c945b882 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3532,
 /**/
     3531,
 /**/