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

[patch] Keep same position in changelist when splitting window

Expand Messages
  • Jacob Niehus
    Currently, the change list index gets reset to zero (oldest change) in a new split window, so typing g; gives an error. I think the index should either get
    Message 1 of 6 , Jul 25, 2014
      Currently, the change list index gets reset to zero (oldest change) in a new split window, so typing 'g;' gives an error. I think the index should either get set to the newest change (as if opening a new buffer) or to the same as the window it's split from. I think the latter is more useful, so I implemented that.

      diff --git a/src/window.c b/src/window.c
      --- a/src/window.c
      +++ b/src/window.c
      @@ -1178,6 +1178,11 @@
      p_wh = size;
      }

      +#ifdef FEAT_JUMPLIST
      + /* Keep same changelist position in new window */
      + wp->w_changelistidx = oldwin->w_changelistidx;
      +#endif
      +
      /*
      * make the new window the current window
      */

      --
      --
      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/d/optout.
    • Bram Moolenaar
      ... Thanks, I had a remark in the todo list to look into this. Bonus points if you can write a test for this. -- Mrs Abbott: I m a paediatrician. Basil: Feet?
      Message 2 of 6 , Jul 26, 2014
        Jacob Niehus wrote:

        > Currently, the change list index gets reset to zero (oldest change) in
        > a new split window, so typing 'g;' gives an error. I think the index
        > should either get set to the newest change (as if opening a new
        > buffer) or to the same as the window it's split from. I think the
        > latter is more useful, so I implemented that.

        Thanks, I had a remark in the todo list to look into this.

        Bonus points if you can write a test for this.

        --
        Mrs Abbott: I'm a paediatrician.
        Basil: Feet?
        Mrs Abbott: Children.
        Sybil: Oh, Basil!
        Basil: Well, children have feet, don't they? That's how they move
        around, my dear. You must take a look next time, it's most
        interesting. (Fawlty Towers)

        /// 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/d/optout.
      • Jacob Niehus
        Bram, Here s a patch with a test included. By the way, test102 fails for me with --with-features=small, and --with-features=tiny won t compile for me at all
        Message 3 of 6 , Jul 26, 2014
          Bram,

          Here's a patch with a test included.

          By the way, test102 fails for me with --with-features=small, and --with-features=tiny won't compile for me at all (there's mouse-related stuff outside of ifdefs).

          -Jake

          --
          --
          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/d/optout.
        • Bram Moolenaar
          ... Thanks. I ll run the tests but I thought it was working for me. Did you include another patch perhaps? -- It is too bad that the speed of light hasn t
          Message 4 of 6 , Jul 27, 2014
            Jacob Niehus wrote:

            > Here's a patch with a test included.
            >
            > By the way, test102 fails for me with --with-features=small, and
            > --with-features=tiny won't compile for me at all (there's
            > mouse-related stuff outside of ifdefs).

            Thanks. I'll run the tests but I thought it was working for me. Did
            you include another patch perhaps?


            --
            It is too bad that the speed of light hasn't kept pace with the
            changes in CPU speed and network bandwidth. -- <wietse@...>

            /// 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/d/optout.
          • Jacob Niehus
            The let command fails because it s built without +eval. diff --git a/src/testdir/test102.in b/src/testdir/test102.in ... +++ b/src/testdir/test102.in @@ -1,6
            Message 5 of 6 , Jul 27, 2014
              The 'let' command fails because it's built without +eval.

              diff --git a/src/testdir/test102.in b/src/testdir/test102.in
              --- a/src/testdir/test102.in
              +++ b/src/testdir/test102.in
              @@ -1,6 +1,7 @@
              Test if fnameescape is correct for special chars like !

              STARTTEST
              +:so small.vim
              :%d
              :let fname = 'Xspa ce'
              :try | exe "w! " . fnameescape(fname) | put='Space' | endtry

              --
              --
              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/d/optout.
            • Bram Moolenaar
              ... I see. When I build and test manually I indeed see this problem. Running my test script doesn t reveal it... -- I have read and understood the above.
              Message 6 of 6 , Jul 27, 2014
                Jacob Niehus wrote:

                > The 'let' command fails because it's built without +eval.
                >
                > diff --git a/src/testdir/test102.in b/src/testdir/test102.in
                > --- a/src/testdir/test102.in
                > +++ b/src/testdir/test102.in
                > @@ -1,6 +1,7 @@
                > Test if fnameescape is correct for special chars like !
                >
                > STARTTEST
                > +:so small.vim
                > :%d
                > :let fname = 'Xspa ce'
                > :try | exe "w! " . fnameescape(fname) | put='Space' | endtry

                I see. When I build and test manually I indeed see this problem.
                Running my test script doesn't reveal it...

                --
                I have read and understood the above. X________________

                /// 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/d/optout.
              Your message has been successfully submitted and would be delivered to recipients shortly.