[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: [kgergely@mlabdial.hit.bme.hu: set scb diff]
From:       Gary Johnson <garyjohn () spk ! agilent ! com>
Date:       2002-12-10 18:41:37
[Download RAW message or body]

On 2002-12-10, KONTRA Gergely <kgergely@mlabdial.hit.bme.hu> wrote:

> > > I sometimes need to see diffs in vim. It is quite usable and pretty.
> > > One thing I miss:
> > > when you change to one window to another, the cursor can go to a quite
> > > different place. Is it possible to sychronize cursor positions?

Not that I know of, but that would be a nice feature.  My primary
reason for wanting that feature is because of the cursor position's
effect on horizontal scrolling.  If the cursor is on a short line in
one window, you can't scroll both windows to see the ends of long
lines.

Consider two files, each containing a very short line followed by a
very long line and let there be some difference between the two
files.  For example:

    ---------------------------- file_1 ----------------------------
    short line
    a very long line almost full of characters to the right margin
    ---------------------------- file_2 ----------------------------
    short line
    a very long line almost full of characters to the right side

Execute 'vimdiff file_1 file_2'.  The cursor will initially be in
the first column of the first line of file_1.  Move the cursor down
to line 2 and then start moving it toward the right end of line 2.
Note that when the cursor reaches the right side of the left window,
both windows start scrolling to the left.  The left window will
continue scrolling until the cursor reaches the last column of line
2.  The right window, however, will continue scrolling only until
its cursor reaches the end of line 1.  In order to see the end of
line 2 in the right window, you have to switch to the right window
and move the cursor down to the second line.

This behavior can be really annoying when one is comparing two files
containing lines of widely varying lengths.

Gary

-- 
Gary Johnson                 | Agilent Technologies
garyjohn@spk.agilent.com     | Spokane, Washington, USA 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic