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

Bug: vimdiff with diffopt-=filler could result in out-of-sync lines

Expand Messages
  • Nazri Ramliy
    Hi, I m attaching the files (a and b) that produces this bug on my system with the terminal height set to 15 lines: $ echo $LINES 15 $ vimdiff -u NONE -c set
    Message 1 of 5 , Jun 24, 2014
    • 0 Attachment
      Hi,

      I'm attaching the files (a and b) that produces this bug on my system
      with the terminal height set to 15 lines:

      $ echo $LINES
      15
      $ vimdiff -u NONE -c 'set diffopt-=filler' -c $ a b
      See that the lines drawn in both windows are out of sync - they
      aren't drawn in the same rows.
      ":windo set nu" will make the problem more apparent.

      nazri

      --
      --
      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
      ... The filler lines are needed to keep the windows in sync. If you disable filler lines they cannot always be in sync. Not a bug. -- Futility Factor: No
      Message 2 of 5 , Jun 25, 2014
      • 0 Attachment
        Nazri Ramliy wrote:

        > I'm attaching the files (a and b) that produces this bug on my system
        > with the terminal height set to 15 lines:
        >
        > $ echo $LINES
        > 15
        > $ vimdiff -u NONE -c 'set diffopt-=filler' -c $ a b
        > See that the lines drawn in both windows are out of sync - they
        > aren't drawn in the same rows.
        > ":windo set nu" will make the problem more apparent.

        The filler lines are needed to keep the windows in sync. If you disable
        filler lines they cannot always be in sync. Not a bug.

        --
        Futility Factor: No experiment is ever a complete failure - it can always
        serve as a negative example.

        /// 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.
      • Nazri Ramliy
        ... I think it is a bug :) The behavior of vimdiff -u NONE -c set diffopt-=filler -c $ a b is inconsistent depending on the height of the terminal. Running
        Message 3 of 5 , Jun 25, 2014
        • 0 Attachment
          On Wed, Jun 25, 2014 at 5:49 PM, Bram Moolenaar <Bram@...> wrote:
          > The filler lines are needed to keep the windows in sync. If you disable
          > filler lines they cannot always be in sync. Not a bug.

          I think it is a bug :)

          The behavior of "vimdiff -u NONE -c 'set diffopt-=filler' -c $ a b" is
          inconsistent
          depending on the height of the terminal.

          Running that command in a terminal that has, say, 41 rows will not
          show the problem.
          WIth a terminal that can only fit 15 lines the problem appears.

          I came across this behavior when I wanted to diff the members of each column
          of a database table arranged vertically so that I can easily spot the
          difference between
          a column member of one row with the corresponding column member of another row -
          hence the diffopt-=filler as I want vim to not show the filler lines
          at all as it makes no
          sense to have filler lines present in this case.

          The two sample files (a and b) contains two different rows of a
          database table - they
          each has the same number of columns (hence the same number of lines).

          My $work laptop didn't have enough screen lines to hide the problem for me when
          showing the diff using the original data hence the bug report :)

          nazri

          --
          --
          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.
        • Christian Brabandt
          Hi Nazri! ... Hm, from a quick look at the problem, it seems that the real problem is that scrollbinded windows try to synchronize changes and therefore
          Message 4 of 5 , Jun 26, 2014
          • 0 Attachment
            Hi Nazri!

            On Mi, 25 Jun 2014, Nazri Ramliy wrote:

            > On Wed, Jun 25, 2014 at 5:49 PM, Bram Moolenaar <Bram@...> wrote:
            > > The filler lines are needed to keep the windows in sync. If you disable
            > > filler lines they cannot always be in sync. Not a bug.
            >
            > I think it is a bug :)
            >
            > The behavior of "vimdiff -u NONE -c 'set diffopt-=filler' -c $ a b" is
            > inconsistent
            > depending on the height of the terminal.
            >
            > Running that command in a terminal that has, say, 41 rows will not
            > show the problem.
            > WIth a terminal that can only fit 15 lines the problem appears.
            >
            > I came across this behavior when I wanted to diff the members of each column
            > of a database table arranged vertically so that I can easily spot the
            > difference between
            > a column member of one row with the corresponding column member of another row -
            > hence the diffopt-=filler as I want vim to not show the filler lines
            > at all as it makes no
            > sense to have filler lines present in this case.
            >
            > The two sample files (a and b) contains two different rows of a
            > database table - they
            > each has the same number of columns (hence the same number of lines).
            >
            > My $work laptop didn't have enough screen lines to hide the problem for me when
            > showing the diff using the original data hence the bug report :)

            Hm, from a quick look at the problem, it seems that the real problem is
            that scrollbinded windows try to synchronize changes and therefore
            depending on the diff state might scroll another window by more than 1
            line.

            In your case, I think it might help to not scrollbind the windows.

            Mit freundlichen Grüßen
            Christian
            --

            --
            --
            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.
          • Nazri Ramliy
            ... That does help making the unsynchronized screen rows problem go away, but only after I move the cursor up and down (jk) after vim starts. That is (in a
            Message 5 of 5 , Jul 1, 2014
            • 0 Attachment
              On Fri, Jun 27, 2014 at 2:05 PM, Christian Brabandt <cblists@...> wrote:
              > Hm, from a quick look at the problem, it seems that the real problem is
              > that scrollbinded windows try to synchronize changes and therefore
              > depending on the diff state might scroll another window by more than 1
              > line.
              >
              > In your case, I think it might help to not scrollbind the windows.

              That does help making the "unsynchronized" screen rows problem go
              away, but only after I move the cursor up and down (jk) after vim
              starts.

              That is (in a terminal with 25 lines):

              $ vimdiff -u NONE -c 'set diffopt-=filler' -c 'windo set nu
              noscrollbind' -c $ a b

              results in the cursor positioned at the last line (line 40) in the
              window on the right, and on the left window the last line shown is
              line 23. Hitting "jk" seems to make vim redraws the correct view for
              the buffer in the left window.

              Looking at the diff shown by vim I can see that vim's diff mode
              wasn't designed to show line-by-line differences in the way that I
              wanted to - for example line 14 of both file are identical but on the
              left window that line has a blue background while in the other window
              the background is black.

              Thanks for the hint!

              nazri

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