# HG changeset patch # User Bram Moolenaar # Date 1634504406 -7200 # Node ID 902aab6dc499b67beeec57454862c1e7a5d9f379 # Parent 847b1374b39ea097810ffdfa07bb88445c9e1f9b patch 8.2.3532: the previous '' mark is restored after moving the cursor Commit: https://github.com/vim/vim/commit/e08aee60abc59f517d3e263fdb9ba4a0196d507c Author: Bram Moolenaar Date: Sun Oct 17 21:53:58 2021 +0100 patch 8.2.3532: the previous '' mark is restored after moving the cursor 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) diff --git a/src/mark.c b/src/mark.c --- a/src/mark.c +++ b/src/mark.c @@ -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) diff --git a/src/testdir/test_marks.vim b/src/testdir/test_marks.vim --- a/src/testdir/test_marks.vim +++ b/src/testdir/test_marks.vim @@ -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('%') diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3532, +/**/ 3531, /**/ 3530,