summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Aubry2012-09-25 09:23:34 (EDT)
committer Kevin KIN-FOO2012-09-26 04:51:53 (EDT)
commitba12d5523c0227e83cebc057c3a04521dc3acc64 (patch)
treee76559b4192cf8a169c49222c791a0fec56c888a
parentcfa6431773c5bd09611e64ea9e9e6bf637e5287a (diff)
downloadorg.eclipse.koneki.ldt-ba12d5523c0227e83cebc057c3a04521dc3acc64.zip
org.eclipse.koneki.ldt-ba12d5523c0227e83cebc057c3a04521dc3acc64.tar.gz
org.eclipse.koneki.ldt-ba12d5523c0227e83cebc057c3a04521dc3acc64.tar.bz2
Bug 388695 - [formatter] formatter should not be run when file is on
error
-rw-r--r--plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/editor/formatter/LuaFormatter.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/editor/formatter/LuaFormatter.java b/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/editor/formatter/LuaFormatter.java
index 70dfb0c..2f6d094 100644
--- a/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/editor/formatter/LuaFormatter.java
+++ b/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/editor/formatter/LuaFormatter.java
@@ -120,6 +120,10 @@ public class LuaFormatter extends AbstractScriptFormatter {
Messages.LuaFormatterUnableToFormatSelection);
Activator.logError(Messages.LuaFormatterUnableToFormatSelection, e);
}
+ } else if (source.equals(formatted)) {
+ // If no modification have be done on the source code when formatting,
+ // avoid the editor to be dirty/stale mode by returning null
+ return null;
}
// Construct text edition
return new ReplaceEdit(offset, length, formatted);