diff options
author | Niraj Modi | 2020-12-08 16:13:29 +0000 |
---|---|---|
committer | Niraj Modi | 2020-12-08 16:38:17 +0000 |
commit | de4586082ceb8daa5475f043babc6bb31b602a02 (patch) | |
tree | 747dbe20634112df99790f9194163604352a189d | |
parent | 87ffb9aefab859d12311daf5df6449c8e9952681 (diff) | |
download | eclipse.platform.team-de4586082ceb8daa5475f043babc6bb31b602a02.tar.gz eclipse.platform.team-de4586082ceb8daa5475f043babc6bb31b602a02.tar.xz eclipse.platform.team-de4586082ceb8daa5475f043babc6bb31b602a02.zip |
Bug 552352 - Using SWAP in Compare editor loses changes and dirty statusY20210113-0120Y20210112-1200Y20210108-1200Y20210105-1200Y20210101-1200Y20201229-1200Y20201229-0040Y20201225-1200Y20201222-1200Y20201218-1200Y20201215-1200Y20201211-1200Y20201209-0750Y20201208-1200S4_19_0_M1I20210114-0510I20210114-0310I20210112-1800I20210112-0850I20210111-1800I20210110-1800I20210109-1830I20210108-1800I20210108-0220I20210106-1800I20210106-0600I20210105-1800I20210105-0600I20210104-1800I20210104-0600I20210103-1800I20210103-0600I20210102-1800I20210102-0600I20210101-1800I20210101-0720I20201231-1800I20201230-2150I20201230-1800I20201229-1800I20201228-1800I20201227-1800I20201226-1800I20201226-0940I20201225-1800I20201225-0450I20201225-0130I20201224-1800I20201223-1800I20201222-1800I20201221-1800I20201220-1800I20201219-1800I20201218-1800I20201217-1800I20201216-2110I20201215-1800I20201214-1800I20201213-1800I20201212-1800I20201211-1800I20201210-1800I20201209-1800I20201208-2310I20201208-1800
Change-Id: Iab835c01242ede0a481d17cafd5f603746695317
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r-- | bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java index cab519f96..daa89d98d 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2018 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -914,6 +914,17 @@ public abstract class ContentMergeViewer extends ContentViewer fSwitchLeftAndRight = new Action() { @Override public void run() { + /* + * Bug 552352: When comparing .txt files with corresponding .txt file editors + * closed and user modifies the content of one of the .txt file in the compare + * view and the compare state becomes 'dirty' and if followed by a 'Swap' + * action, modifications get lost. This data loss is considered a severe + * problem, so to avoid this modified data loss in this scenario, show a + * confirmation dialog to 'save' the file before swapping and let user decide + * and take a call on this. Note: Issue not seen with .java & .properties files. + */ + doSave(null, getInput()); + IPreferenceStore preferences = getCompareConfiguration().getPreferenceStore(); preferences.setValue(ComparePreferencePage.SWAPPED, !getCompareConfiguration().isMirrored()); if (preferences instanceof IPersistentPreferenceStore) { |