Loading ...
Sorry, an error occurred while loading the content.
 

Re: [bugreport] position of mark " not updated in contrast to position of other marks

Expand Messages
  • Bram Moolenaar
    ... So: when inserting lines most marks get adjusted, but the mark isn t. Looks like a bug. -- A hamburger walks into a bar, and the bartender says: I m
    Message 1 of 5 , Feb 5, 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”.

      So: when inserting lines most marks get adjusted, but the " mark isn't.
      Looks like a bug.


      --
      A hamburger walks into a bar, and the bartender says: "I'm sorry,
      but we don't serve food here."

      /// Bram Moolenaar -- Bram@... -- 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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Christian Brabandt
      Hi Roland! ... This patch fixes it: diff --git a/src/mark.c b/src/mark.c ... +++ b/src/mark.c @@ -1047,6 +1047,7 @@ #ifdef FEAT_WINDOWS tabpage_T *tab; #endif
      Message 2 of 5 , Feb 5, 2013
        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 vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Bram Moolenaar
        ... Thanks! -- Arthur pulls Pin out. The MONK blesses the grenade as ... ARTHUR: (quietly) One, two, five ... GALAHAD: Three, sir! ARTHUR: Three. Monty
        Message 3 of 5 , Feb 6, 2013
          Christian Brabandt wrote:

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

          Thanks!

          --
          Arthur pulls Pin out. The MONK blesses the grenade as ...
          ARTHUR: (quietly) One, two, five ...
          GALAHAD: Three, sir!
          ARTHUR: Three.
          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

          /// Bram Moolenaar -- Bram@... -- 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 vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Roland Eggner
          ... vim community works with unbelievable speed ... bugfix within 6 hours mainline within 21 hours @ all: Thank you! -- Roland Eggner
          Message 4 of 5 , Feb 6, 2013
            On 2013-02-05 Tuesday at 21:42 +0100 Christian Brabandt wrote:
            > 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:


            vim community works with unbelievable speed
            -------------------------------------------

            bugfix within 6 hours
            mainline within 21 hours


            @ all:
            Thank you!


            --
            Roland Eggner
          Your message has been successfully submitted and would be delivered to recipients shortly.