While the new diff UI looks quite nice, the scrolling logic is broken. I use F12
to jump through changes. Usually the right pane (new source) is scrolled
acceptably, but the left pane is often not scrolled to a reasonable position.
Sometimes the old block is even scrolled offscreen completely! Furthermore, when
the old and new blocks are not aligned, it is difficult to see the lines
connecting them, because the angle is too steep, and (especially in a densely
changed region like the imports section) the lines often overlap with other
Please play with this a bit. I would prefer for both the old and new blocks to
always be centered in their respective panes. This would let my eyes rest on the
center of screen rather than having to look up and down repeatedly, and it would
ensure that the blocks were reasonably well aligned.
I agree that when using Next/Previous Difference actions the selected difference
should be completely visible on both sides and aligned (if possible). I'll try
to tune the scrolling engine and if that fails then hardcoding it to treat
Next/Previous actions and Scrollbar differently. I'd appreciate if you give an
example (file revisions) when this behavior clearly manifests.
I guess I don't have any particular example in mind; seems to happen
consistently for all sorts of changes I make. Next time I am doing a diff I
could attach some screenshots if that would be helpful. Probably changes which
involve adding or deleting significant blocks of code would show it more, since
then the line numbers are out of synch between the old and new buffers.
Created attachment 40050 [details]
Screenshot showing misaligned diff blocks (still all on screen; no off-screen problems in this diff)
Created attachment 40230 [details]
Screenshot showing even more misaligned diff
Should be better now.
new revision: 1.24; previous revision: 1.23
Created attachment 51522 [details]
Screenshot from dev build
Doesn't seem any better; see recent screenshot. In this case the scrollbar is at the bottom despite the fact that the
old text is not completely visible. The only way to see what code is being replaced is to put the cursor in the left
editor pane and move it down with arrow keys. In such a case the active diff block is reset to be one further up; after
pressing Ctrl-. the end of the old file is hidden again. Generally, I am having the same kind of problems I was having
before, so I'm not sure what was fixed.
I should also mention that Ctrl-. very frequently skips over one or more diff blocks, so that I will often press Ctrl-.
while in one file and find myself 2/3 of the way down into another file. (Ctrl-, seems to reliably go backward one diff
block at a time.) Overall, very irritating - I am never sure that I have actually seen all of the changes I made.
Completely agree with jglick, got the same sort of misbehavior.
I have made additional improvements during recent months, please verify.
Created attachment 57822 [details]
Screenshot using current sources
Perhaps better than it was, but still fails to scroll to show the entire modified region in many common cases. Just try
inserting or deleting half-screen-sized blocks of text randomly and browse diffs; scrolling is definitely less than optimal.
Still quite bad, often unusable.
Still bordering on unusable. Refactoring preview for Inspect & Transform, even something that does not add or remove lines - e.g. remove final modifier from static methods - will typically scroll to show old code on left side but show a completely different section of the new file on the right side.
Same scrolling/centering problems persist. Also noticed that Ctrl-PERIOD often skips over some diff hunks; have to use Ctrl-COMMA several times to "back up" and hope that this will make the skipped hunk visible (but usually requires manual correction with scrollbars).
Created attachment 148026 [details]
fully working I&T preview window
(In reply to Jesse Glick from comment #11)
> Created attachment 57822 [details]
> Screenshot using current sources
Is this really a problem? Where should it scroll, to the end of the file? I personally don't mind the current behavior, i simply scroll the left panel down to see the whole deleted hunk.
(In reply to Jesse Glick from comment #12)
> Perhaps better than it was, but still fails to scroll to show the entire
> modified region in many common cases. Just try
> inserting or deleting half-screen-sized blocks of text randomly and browse
> diffs; scrolling is definitely less than optimal.
Please can you attach an up-to-date screenshot and describe on that example?
(In reply to Jesse Glick from comment #14)
> Still bordering on unusable. Refactoring preview for Inspect & Transform,
> even something that does not add or remove lines - e.g. remove final
> modifier from static methods - will typically scroll to show old code on
> left side but show a completely different section of the new file on the
> right side.
Can you reproduce? Seems to work fine for me in dev builds, see the attached screenshot...
(In reply to Jesse Glick from comment #15)
> Also noticed that Ctrl-PERIOD
> often skips over some diff hunks; have to use Ctrl-COMMA several times to
> "back up" and hope that this will make the skipped hunk visible (but usually
> requires manual correction with scrollbars).
I do not experience this. Even if the hunks are really close to each other, next/prev always steps just to the closest neighbor, never skips any hunk.
Created attachment 148027 [details]
however i noticed a weird scrolling (not sure if the one you're talking about) - see the sc1.png - three active diff hunks. The screenshot shows that the middle hunk actually scrolls the left view to a higher line than the third one - which is obviously wrong and confusing. I'll try to do something with this at least.
i did what i could, i sincerely hope i didn't make it worse.
Integrated into 'main-silver', will be available in build *201407190718* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Ondrej Vrabec <email@example.com>
Log: #99059 - Bad scrolling behavior in diff window
Improve jumping between current differences when scrolling.
When scrolling the right panel differences are switched more smoothly
and should now take into account the direction of scrolling.
Do not recall seeing unreasonable behavior recently in dev builds.