Thanks for the clarification.

I think this behaviour can't be avoided..

In your example, when you go 22j you end up on line 23 in the old file.
The cursorbind code asks Vim for the corresponding line in the new file,
and since the line no longer exists the "corresponding line" is returned
as the one after the deleted block.

Since Vim does not allow the cursor to journey outside the window, this
causes the "new" window to jump up a few lines.

The "old" window won't also jump to compensate since it's the active
window. I worry that making the old window adjust its position after
adjusting the cursor in the slave windows could lead to strange infinite
loop situations....

Vince

-----Original Message-----
From: vim_dev@googlegroups.com [mailto:vim_...@googlegroups.com]on
Behalf Of Jürgen Krämer
Sent: 19 March 2009 09:17
To: vim_dev@googlegroups.com
Subject: Re: Concel and Ownsyntax patch FINALLY updated...



Hi Vince,

Vince Negri wrote:
> 
> I don't understand the description of the problem. You say you run
> 
>   gvim -d -u NONE --cmd "set so=99" old-version.txt new-version.txt
> 
> But that is setting scrolloffset, not cursorbind. I don't see where
> cursorbind is being enabled.

it seems cursorbind was set by invoking gvim with the -d flag. You can
check this with the attached files. After executing the above command

  :windo verbose setlocal cursorbind?

shows

    cursorbind
    cursorbind

If you replace the -d flag with -O, the :windo command shows

  nocursorbind
  nocursorbind

With the attached files you can also reproduce the behaviour mentioned
in my first mail. It seems so=99 is not necessary for this, just run

  gvim -d -u NONE old-version.txt new-version.txt

and enter

  22j

The cursor is now on the last line in the left window ("these lines")
and the right window has been scrolled upwards by two lines, showing
the missing lines (represented by dashes) above the corresponding block
of the left window. This does not happen if cursorbind is reset in at
least one of the windows.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui