Page Up/Down

Support for our DiffMerge utility.

Moderator: SourceGear

Post Reply
ferrad
Posts: 5
Joined: Thu May 21, 2009 2:57 am

Page Up/Down

Post by ferrad » Thu May 21, 2009 3:01 am

I have just installed this, and it looks good. However Page Up / Down only moves up/down only one line at first, then afterwards a full page. I am used to Page Up / Down always moving a page at a time. Is this a bug?

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: Page Up/Down

Post by jeffhostetler » Thu May 21, 2009 8:01 am

It may be an artifact of the documents you are comparing. There are
a few things competing here: the caret position, where the first change is,
and the scroll position.

On Windows (yes, the answer is different on different platforms), the
PageDown tries to move the caret 1 pages-worth of rows and then scrolls
if necessary to make the caret visible. This is a little different from the
Ctrl-PageDown (or using the scrollbar) which scrolls the window without
moving the caret. (Yes, this is confusing.)

When DiffMerge opens a window, it warp scrolls to the first change (but
doesn't move the caret (this may be the bug)). So, it may be that if in
the documents you are comparing, the first change is near enough to the
top of the documents for the caret to be off-screen by almost a page. So
the first PageDown moves the caret into view with a minimal scroll and the
second moves and scrolls a full page.

To test this idea: after opening a new window, click somewhere on the
content to bring the caret into view and then hit PageDown and see if it
behaves differently.

Sorry for the long-winded answer, but I think that is what is happening.
Let me know either way what happens. I've logged a bug for this issue.

thanks,
jeff

item:14351

ferrad
Posts: 5
Joined: Thu May 21, 2009 2:57 am

Re: Page Up/Down

Post by ferrad » Fri May 22, 2009 1:21 am

I am comparing 2 very similar straight text files (F90 Fortran source code), 86 lines are visible. If I do a bunch of Page-Ups, the file displays from the beginning and the caret (by caret I assume you mean cursor) ends up at the top of the page. Lines 1-86 are visible. Now if I do a Page-Down, the screen shifts down only 1 row (so lines 2-87 are visible), with the caret at the bottom on line 87. This is difference in expected behavior between DiffMerge and CompareIT or any other editor I have used. These products will scroll the entire page down (showing lines 87-172, with the caret on line 87, ie. still at the top of the display). Try it in Notepad for example. It only works as expected if the caret as at the last line in the display. The same problem happens for Page-Up but in reverse.

I use PageUp and PageDown to quickly move in the file, but a sequential PageUp-PageDown-PageUp-PageDown effectively shows exactly the same set of lines.

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: Page Up/Down

Post by jeffhostetler » Fri May 22, 2009 8:01 am

I'll have to log this and investigate this later. (I'm currently sitting with a
Mac laptop that doesn't have PageUp/PageDown keys, sigh.)

jeff

Post Reply