Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-07-24 05:57:21 -0400
committerAndrey Loskutov2017-07-24 05:57:21 -0400
commit60e96d05bc01ef6c95c35a351bed183995d97849 (patch)
tree74644ea20300b28a6bd72a5bad12fcdf79bc9fda /bundles
parent3a938dd648842abdf80f8cde84ad3b9686d1369d (diff)
downloadeclipse.platform.team-60e96d05bc01ef6c95c35a351bed183995d97849.tar.gz
eclipse.platform.team-60e96d05bc01ef6c95c35a351bed183995d97849.tar.xz
eclipse.platform.team-60e96d05bc01ef6c95c35a351bed183995d97849.zip
Revert "Bug 512395 - "Copy all from right to left" has no effect in some cases"I20170724-2000
Diffstat (limited to 'bundles')
-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 f2d3426e5..5b07e4ba9 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
@@ -4869,15 +4869,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