This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | "Replace With Original Text" will revert to code with the last part missing | ||
---|---|---|---|
Product: | versioncontrol | Reporter: | swpalmer <swpalmer> |
Component: | Code | Assignee: | Ondrej Vrabec <ovrabec> |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 8.0 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | diff sidebar |
Description
swpalmer
2014-05-27 19:10:52 UTC
Created attachment 147476 [details]
diff sidebar
i'm getting the same, see the screenshot. But in that case there are actually two diff chunks (notice the pink triangle at the bottom), you must of course revert both of them. Happens when Tools -> Options -> Misc -> Diff | Internal Diff and Ignore Leading and Trailing WS is selected. So simply: - either turn off the option in Options and reopen the file - or make sure you revert both the diff chunks Or could it be that you cannot see two diffs as opposed to the screenshot? I do see what is happening now and it is very non-intuitive. I think this should still be addressed, but at a lower priority. The pink triangle is shown outside of the method body below the closing brace. It may be doing something that is technically correct according to the diff algorithm, but it is not doing the right thing in terms of UI. After restoring both blocks you end up with code where the indentation of the braces is completely wrong. You do NOT get back to where you were before! This is what I get after reverting both changes - the blue bar and the pink triangle: private void bindContainerForVisibility(PropertyGroupUIStuff pgStuff) { if (pgStuff.panel instanceof TitledPane) { TitledPane tp = (TitledPane) pgStuff.panel; ObservableBooleanValue visibleCondition = null; Parent contentContainer = (Parent) tp.getContent(); ObservableList<Node> content = contentContainer.getChildrenUnmodifiable(); for (int i = 0; i < content.size(); i++) { Node n = content.get(i); if (n.getUserData() instanceof PropertyRowInfo) { PropertyRowInfo pri = (PropertyRowInfo) n.getUserData(); if (visibleCondition == null) { visibleCondition = pri.visible; } else { visibleCondition = Bindings.or(visibleCondition, pri.visible); } } } tp.managedProperty().bind(tp.visibleProperty()); if (visibleCondition != null) { tp.visibleProperty().bind(visibleCondition); } } } See that closing brace in the middle? It just looks and feels wrong. If it can be improved it should be improved. Changing to P4, since unselecting "Ignore Leading And Tailing White Space" avoids the issue. I still think reverting both changesets implies that the state should be what it was prior to those changes, but perhaps I can be convinced otherwise. Maybe the algorithm to ignore leading and trailing white space can be a little bit smarter, because it doesn't produce a good result in this case. |