Hi Roland!

On Di, 05 Feb 2013, Roland Eggner wrote:

> How to reproduce
> ----------------
> 
> printf '%s\n' 'line 2' 'line 3'  > example.txt
> LC_ALL=C vim -u NONE + -c 'norm mam"ggOline 1' example.txt
> 
> 
> 
> Observed result
> ---------------
> 
> :marks
> mark line  col file/text
>  '      3    0 line 3
>  a      3    0 line 3
>  "      2    0 line 2
> 
> 
> Expected result
> ---------------
> 
> Mark " should refer to line 3, similarily as mark a .  This would be useful 
> when 
> file enter position has been set by a last-position-jump BufRead-autocommand, 
> and after some editing work I want to jump back to this “last-position”.

This patch fixes it:

diff --git a/src/mark.c b/src/mark.c
--- a/src/mark.c
+++ b/src/mark.c
@@ -1047,6 +1047,7 @@
 #ifdef FEAT_WINDOWS
     tabpage_T  *tab;
 #endif
+    static pos_T initpos = INIT_POS_T(1, 0, 0);
 
     if (line2 < line1 && amount_after == 0L)       /* nothing to do */
        return;
@@ -1072,6 +1073,10 @@
        /* last change position */
        one_adjust(&(curbuf->b_last_change.lnum));
 
+       /* last cursor position, if it was set */
+       if (!equalpos(curbuf->b_last_cursor, initpos))
+           one_adjust(&(curbuf->b_last_cursor.lnum));
+
 #ifdef FEAT_JUMPLIST
        /* list of change positions */
        for (i = 0; i < curbuf->b_changelistlen; ++i)



regards,
Christian
-- 
Der Satiriker ist ein Mann, der seines Lebens nicht sicher ist, weil
er die Wahrheit zur Schau trägt.
                -- Christian August Vulpius

-- 
-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui