Steps to reproduce:
- create a file with 40 lines. E.g.:
$ seq 1 40 >test.txt
- create a Vim script file (e.g. called do.vim) with the following contents:
#v+
let @a = "text put before line 1"
let @b = "text put before line 11"
let @c = "text put before line 21"
normal 1G
normal 10G
normal 20G
normal 30G
normal 40G
redir @z
jumps
keepjumps 1put! a
keepjumps 11put! b
keepjumps 21put! c
jumps
redir END
$put z
normal G
#v-

- execute the script on the previously created 40-line file:
$ vim -i /dev/null -S do.vim test.txt

The last lines of the file will be:

#v+
 jump line  col file/text
   4     1    0 1
   3    10    0 10
   2    20    0 20
   1    30    0 30
>
 jump line  col file/text
   4     2    0 1
   3    12    0 10
   2    23    0 20
   1    33    0 30
>
#v-

(i.e. there will be difference in the "line" column between the two :jumps
invocations), while they should be:

#v+
 jump line  col file/text
   4     1    0 1
   3    10    0 10
   2    20    0 20
   1    30    0 30
>
 jump line  col file/text
   4     1    0 text put before line 1
   3    10    0 9
   2    20    0 18
   1    30    0 27
>
#v-

The attached patch fixes the problem.

-- 
Cheers,
Lech

-- 
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

To unsubscribe, reply using "remove me" as the subject.
diff --git a/src/mark.c b/src/mark.c
index ae31cf0..ae0d710 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -1090,7 +1090,7 @@ mark_adjust(line1, line2, amount, amount_after)
     FOR_ALL_TAB_WINDOWS(tab, win)
     {
 #ifdef FEAT_JUMPLIST
-	if (!cmdmod.lockmarks)
+	if (!cmdmod.keepjumps)
 	    /* Marks in the jumplist.  When deleting lines, this may create
 	     * duplicate marks in the jumplist, they will be removed later. */
 	    for (i = 0; i < win->w_jumplistlen; ++i)

Raspunde prin e-mail lui