Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 188779 - Diff not working with line wrapping
Diff not working with line wrapping
Product: utilities
Classification: Unclassified
Component: Diff
PC Windows Vista
: P3 (vote)
: 7.0
Assigned To: Ondrej Vrabec
: 189696 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2010-07-20 08:49 UTC by Tomas Pavek
Modified: 2015-09-10 08:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Pavek 2010-07-20 08:49:32 UTC
The diff view is broken when editor line wrapping is on, it is keeps blinking (repositioning), consuming all CPU.

Seen in dev build 201007200001.
Comment 1 Ondrej Vrabec 2010-07-30 09:08:54 UTC
While i was testing the diff with enabled line-wrapping (both switch and wrapping after words on), i came across two problems. They appear *only* when the wrapping after words/everywhere is enabled. When i *only* set the commandline switch to true (org.netbeans.modules.editor.linewrap=true) but leave the linewrapping off (in Tools > Options > Editor), everything works just fine.

1) diff markers in the editor (the bar on the left side of the editor) - the markers are initially displayed on the correct line. However as i scroll through a long file, the editor starts blinking after a while, seems to be recalculating something and all annotations (diff markers as well as other annotations) are relocated several lines above/below. This seems to be an editor problem.

2) broken diff view (Mercurial > Diff) - the diff view constantly resizes itself, repaints and never stops blinking.
I think the cause of this is the following: diff listens for changes in panel's size, recalculates highlighting in reaction for this event and fires a highlightChanged event. But then the editor seems to rebuild the view hierarchy (or something like that), resizes the pane and thus triggers the diff recalculation and the cycle is started again. This loop never finishes. I guess this can be fixed on our side (in diff), i just mention this because it worked fine with the old view hierarchy's implementation (and even with the new implementation at the end of 6.9 development cycle).

milo, could you look into the editor-related part of the problem?
Comment 2 alex007 2010-08-04 13:10:28 UTC
I have the same issues in the latest build. Also I took this error after some time of blinking the diff page
Comment 3 Miloslav Metelka 2010-08-09 13:55:25 UTC
Yes, I'm still working on resolving of this. Basically all paragraph-view rebuilds (e.g. after a re-parse) need to retain previously present paragraph-view spans to avoid scrollbar going back and forth. Otherwise current lazy-children views computation would assign default line heights to paragraph views and painting/measuring that comes afterwards would initialize the children and expand the paragraph-view's height. Unfortunately with the present version of the fix there are still cases that need fixing.
Comment 4 Miloslav Metelka 2010-08-10 08:35:03 UTC
I have modified the fix and it now appears to work fine.
Comment 5 Miloslav Metelka 2010-08-10 11:37:34 UTC
It seems that the diff works fine now so marking as fixed. Please reopen the issue if the problems would persist.
Comment 6 Miloslav Metelka 2010-08-10 12:21:37 UTC
I must reopen since a left view of the diff view appears sometimes shifted up when line wrapping is on and the the window's width becomes narrow. Reassigning to Ondra for evaluation.
Comment 7 Quality Engineering 2010-08-11 03:13:12 UTC
Integrated into 'main-golden', will be available in build *201008110001* on (upload may still be in progress)
User: Miloslav Metelka <>
Log: #188779 - Diff not working with line wrapping - With line wrapping on the view changed vertical size frequently during typing.
Comment 8 Tomas Stupka 2010-08-11 12:24:50 UTC
happens only occasionally, resizing the diff window a bit seems to fix the problem.
lowering priority for now...
Comment 9 Quality Engineering 2010-08-25 03:25:10 UTC
Integrated into 'main-golden', will be available in build *201008250001* on (upload may still be in progress)
User: Ondrej Vrabec <>
Log: #188779 - Diff not working with line wrapping
fixing problems in the slider between diff panes
Comment 10 Jesse Glick 2011-11-01 19:12:01 UTC
Dupe of bug #189696?
Comment 11 Tomas Stupka 2011-11-02 19:46:43 UTC
issue #189696 is duplicate of what was reported in comment #6 and fixed by ovrabec in #ae27bc307c4f

this one is not closed because there are still some problems with diff when line wrapping is on.
Comment 12 Tomas Stupka 2011-11-02 19:46:49 UTC
*** Bug 189696 has been marked as a duplicate of this bug. ***
Comment 13 Ondrej Vrabec 2015-09-10 08:29:48 UTC
Lot has been fixed in diff regarding line-wrapping. If there is a specific problem, let's file a separate issue.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo