Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-07-24 05:57:21 -0400
committerAndrey Loskutov2017-07-24 11:52:21 -0400
commita35f1a475075e2f6f436714bb682207d144ff08f (patch)
treeddfae4ecafbf3fb8085e04e6deb4ac185e57fcd3
parent37a31f48f9967a62e3e66495668f7793a0c265c8 (diff)
downloadeclipse.platform.team-a35f1a475075e2f6f436714bb682207d144ff08f.tar.gz
eclipse.platform.team-a35f1a475075e2f6f436714bb682207d144ff08f.tar.xz
eclipse.platform.team-a35f1a475075e2f6f436714bb682207d144ff08f.zip
Revert "Bug 512395 - "Copy all from right to left" has no effect in some
cases" This reverts commit 4c395500d1ea10ec726ce49d3c66d0d43295aeb9. Change-Id: I9d389fb7b2145db9df41d6467d7a1c89f3552409 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java27
1 files changed, 20 insertions, 7 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 7c120419d..31811ca77 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
@@ -4953,15 +4953,28 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
try {
for (Iterator<?> iterator = fMerger.changesIterator(); iterator.hasNext();) {
Diff diff = (Diff) iterator.next();
- int kind = diff.getKind();
- if (kind != RangeDifference.LEFT && kind != RangeDifference.RIGHT) {
+ switch (diff.getKind()) {
+ case RangeDifference.LEFT:
+ if (leftToRight) {
+ if (!compoundChangeStarted) {
+ target.beginCompoundChange();
+ compoundChangeStarted= true;
+ }
+ copy(diff, leftToRight);
+ }
+ break;
+ case RangeDifference.RIGHT:
+ if (!leftToRight) {
+ if (!compoundChangeStarted) {
+ target.beginCompoundChange();
+ compoundChangeStarted= true;
+ }
+ copy(diff, leftToRight);
+ }
+ break;
+ default:
continue;
}
- if (!compoundChangeStarted) {
- target.beginCompoundChange();
- compoundChangeStarted = true;
- }
- copy(diff, leftToRight);
}
} finally {
if (compoundChangeStarted) {

Back to the top