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

Re: [patch] 'scrollbind' causes unexpected scroll of one of the windows

Expand Messages
  • Lech Lorens
    ... Yes, this is what I tried to explain above but somehow didn t make it clear ;-) ... Yeah, since the test doesn t work anyway, I didn t bother to make it
    Message 1 of 5 , Jun 30, 2013
    • 0 Attachment
      On 30-Jun-2013 Bram Moolenaar <Bram@...> wrote:
      >
      > Lech Lorens wrote:
      >
      > > I discovered a problem with the 'scrollbind' setting which causes one of
      > > the bound windows to scroll unexpectedly introducing an offset to the
      > > bounding thus effectively destroying the desired setup.
      > >
      > > The attached script scb-problem.vim when sourced will make the problem
      > > apparent. The intention is for the line "line X" on the left to be
      > > aligned with line "LINE Y" on the right. The actual situation is that
      > > after the script runs I get an offset of 523 lines between the windows.
      > >
      > > The attached patch fixes it and provides a test.
      > > But NOTE!
      > > In its current shape the test is pretty much useless: it doesn't
      > > reproduce the problem even before applying the patch. Sorry, but try as
      > > I may, I can't transform scb-problem.vim into a useful test for Vim.
      > > Perhaps someone more knowledgeable will be able to change a line or two
      > > to make it work. If it happens so, I would be extremely grateful if
      > > someone would explain to me what is wrong with my approach.
      >
      > The fix seems OK. But the test already passes without it.

      Yes, this is what I tried to explain above but somehow didn't make it
      clear ;-)

      > Also, the test changes the window height, which is nasty.

      Yeah, since the test doesn't work anyway, I didn't bother to make it
      "prettier" here.

      > Perhaps you can make it work by forcing a redraw?

      I did try. I'll try using a debugger to find out why it doesn't work.
      Perhaps then I can find out how to make it work.

      Thanks for including those patches so quickly!

      --
      Lech Lorens

      --
      --
      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.
    • Lech Lorens
      ... I did use a debugger to find out that using normal-mode commands triggers a different kind of redraw than using command-mode commands (i.e. :source! causes
      Message 2 of 5 , Jul 8 4:09 PM
      • 0 Attachment
        On 30-Jun-2013 Lech Lorens <lech.lorens@...> wrote:
        > On 30-Jun-2013 Bram Moolenaar <Bram@...> wrote:
        > > The fix seems OK. But the test already passes without it.
        >
        > Yes, this is what I tried to explain above but somehow didn't make it
        > clear ;-)
        >
        > > Also, the test changes the window height, which is nasty.
        >
        > Yeah, since the test doesn't work anyway, I didn't bother to make it
        > "prettier" here.
        >
        > > Perhaps you can make it work by forcing a redraw?
        >
        > I did try. I'll try using a debugger to find out why it doesn't work.
        > Perhaps then I can find out how to make it work.

        I did use a debugger to find out that using normal-mode commands
        triggers a different kind of redraw than using command-mode commands
        (i.e. :source! causes different behaviour than :source).
        I worked the problem around by introducing a helper file which is
        sourced by the test. Perhaps this approach is acceptable.

        The attached patch includes a fix and a test which fails before applying
        the fix and succeeds afterwards.

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

        ---
        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. I verified the test fails without the patch. -- If you only have a hammer, you tend to see every problem as a nail. If you only have MS-Windows,
        Message 3 of 5 , Jul 9 4:45 AM
        • 0 Attachment
          Lech Lorens wrote:

          > On 30-Jun-2013 Lech Lorens <lech.lorens@...> wrote:
          > > On 30-Jun-2013 Bram Moolenaar <Bram@...> wrote:
          > > > The fix seems OK. But the test already passes without it.
          > >
          > > Yes, this is what I tried to explain above but somehow didn't make it
          > > clear ;-)
          > >
          > > > Also, the test changes the window height, which is nasty.
          > >
          > > Yeah, since the test doesn't work anyway, I didn't bother to make it
          > > "prettier" here.
          > >
          > > > Perhaps you can make it work by forcing a redraw?
          > >
          > > I did try. I'll try using a debugger to find out why it doesn't work.
          > > Perhaps then I can find out how to make it work.
          >
          > I did use a debugger to find out that using normal-mode commands
          > triggers a different kind of redraw than using command-mode commands
          > (i.e. :source! causes different behaviour than :source).
          > I worked the problem around by introducing a helper file which is
          > sourced by the test. Perhaps this approach is acceptable.
          >
          > The attached patch includes a fix and a test which fails before applying
          > the fix and succeeds afterwards.

          Thanks. I verified the test fails without the patch.

          --
          If you only have a hammer, you tend to see every problem as a nail.
          If you only have MS-Windows, you tend to solve every problem by rebooting.

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