Wednesday, September 5, 2012

Re: Diff 2 files with lines added at top of second file: confusing

> If I shot beside the mark, then please explain better; maybe I hadn't
> drunk enough black tea.
> Best regards,
>
> Tony.

Thank you Tony, I appreciate your time giving me all those details. I will try a couple more things (I might have misused set go+=/set go-=).

But with my original settings, and others I tried (including left and right scroll bars) , I can always see the diff, but *not* initially: I have to click and scroll, and that's too much intervention, too easy to forget.

Background: I have been using gvim as my diff viewer for tortoise svn. It works great, except that recently I committed unwanted changes (at the top of a file) because I forgot to click on the correct window and scroll. The diff initially displays like there is no line added at the top of the file (and I did not expect any either).

I would like vim to automatically scroll to the "highest" of the 2 files (either by code change, auto command, script, whatever...).

I was really happy about using gvim -d file1 file2 +"windo 0" but it only works when file1 has more lines (or maybe the reverse, I forgot). I want a reliable way to start my diff.

I'm fairly sure this can be explained with the current mechanisms in vim, but it does not give me the behavior that I would like.

I'll try looking at which vim functions are available and see if this could be done with a script (focus on the windows where the first added block is and scroll to the top of that window?).

Thanks again,
Christophe

--
You received this message from the "vim_use" 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

No comments:

Post a Comment