Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-04-09 20:14:59 +0000
committerMichael Valenta2007-04-09 20:14:59 +0000
commit002e1ec8ef12bd67ccafd7fa8c998c12ca8cbb6a (patch)
tree1c1c44af24ea909972c8e79ed0d6622ef602caa6 /bundles/org.eclipse.compare
parent5d855b290688732dab545fdc78c47bc77a52146e (diff)
downloadeclipse.platform.team-002e1ec8ef12bd67ccafd7fa8c998c12ca8cbb6a.tar.gz
eclipse.platform.team-002e1ec8ef12bd67ccafd7fa8c998c12ca8cbb6a.tar.xz
eclipse.platform.team-002e1ec8ef12bd67ccafd7fa8c998c12ca8cbb6a.zip
Bug 172198 [Viewers] Don't hide highlighted changes with selection when steppingI20070409
Diffstat (limited to 'bundles/org.eclipse.compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java26
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java26
2 files changed, 42 insertions, 10 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 16844ba22..24731bac8 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -4490,7 +4490,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
diff = getWrappedDiff(diff, down);
}
if (diff != null)
- setCurrentDiff(diff, true);
+ setCurrentDiff(diff, true, deep);
if (diff != null && diff.fDirection == RangeDifference.ANCESTOR
&& !isAncestorVisible())
continue;
@@ -4680,6 +4680,15 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
* selected in both TextParts.
*/
private void setCurrentDiff(Diff d, boolean revealAndSelect) {
+ setCurrentDiff(d, revealAndSelect, false);
+ }
+
+ /*
+ * Set the currently active Diff and update the toolbars controls and lines.
+ * If <code>revealAndSelect</code> is <code>true</code> the Diff is revealed and
+ * selected in both TextParts.
+ */
+ private void setCurrentDiff(Diff d, boolean revealAndSelect, boolean deep) {
// if (d == fCurrentDiff)
// return;
@@ -4694,10 +4703,17 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
// before we set fCurrentDiff we change the selection
// so that the paint code uses the old background colors
// otherwise selection isn't drawn correctly
- if (isThreeWay() && !isIgnoreAncestor())
- fAncestor.setSelection(d.fAncestorPos);
- fLeft.setSelection(d.fLeftPos);
- fRight.setSelection(d.fRightPos);
+ if (d.fIsToken || !fHighlightTokenChanges || deep || !d.hasChildren()) {
+ if (isThreeWay() && !isIgnoreAncestor())
+ fAncestor.setSelection(d.fAncestorPos);
+ fLeft.setSelection(d.fLeftPos);
+ fRight.setSelection(d.fRightPos);
+ } else {
+ if (isThreeWay() && !isIgnoreAncestor())
+ fAncestor.setSelection(new Position(d.fAncestorPos.offset, 0));
+ fLeft.setSelection(new Position(d.fLeftPos.offset, 0));
+ fRight.setSelection(new Position(d.fRightPos.offset, 0));
+ }
// now switch diffs
fCurrentDiff= d;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 16844ba22..24731bac8 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -4490,7 +4490,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
diff = getWrappedDiff(diff, down);
}
if (diff != null)
- setCurrentDiff(diff, true);
+ setCurrentDiff(diff, true, deep);
if (diff != null && diff.fDirection == RangeDifference.ANCESTOR
&& !isAncestorVisible())
continue;
@@ -4680,6 +4680,15 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
* selected in both TextParts.
*/
private void setCurrentDiff(Diff d, boolean revealAndSelect) {
+ setCurrentDiff(d, revealAndSelect, false);
+ }
+
+ /*
+ * Set the currently active Diff and update the toolbars controls and lines.
+ * If <code>revealAndSelect</code> is <code>true</code> the Diff is revealed and
+ * selected in both TextParts.
+ */
+ private void setCurrentDiff(Diff d, boolean revealAndSelect, boolean deep) {
// if (d == fCurrentDiff)
// return;
@@ -4694,10 +4703,17 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
// before we set fCurrentDiff we change the selection
// so that the paint code uses the old background colors
// otherwise selection isn't drawn correctly
- if (isThreeWay() && !isIgnoreAncestor())
- fAncestor.setSelection(d.fAncestorPos);
- fLeft.setSelection(d.fLeftPos);
- fRight.setSelection(d.fRightPos);
+ if (d.fIsToken || !fHighlightTokenChanges || deep || !d.hasChildren()) {
+ if (isThreeWay() && !isIgnoreAncestor())
+ fAncestor.setSelection(d.fAncestorPos);
+ fLeft.setSelection(d.fLeftPos);
+ fRight.setSelection(d.fRightPos);
+ } else {
+ if (isThreeWay() && !isIgnoreAncestor())
+ fAncestor.setSelection(new Position(d.fAncestorPos.offset, 0));
+ fLeft.setSelection(new Position(d.fLeftPos.offset, 0));
+ fRight.setSelection(new Position(d.fRightPos.offset, 0));
+ }
// now switch diffs
fCurrentDiff= d;

Back to the top