diff options
author | bchilds | 2007-11-26 22:34:58 +0000 |
---|---|---|
committer | bchilds | 2007-11-26 22:34:58 +0000 |
commit | 1852efaf932c33dd4e0069b8160111b821137eca (patch) | |
tree | 432908ad3fd239617e5ef0a85357e9d71ed47c26 /bundles/org.eclipse.wst.jsdt.web.ui/src/org | |
parent | d0fef958b48e2cf36569facd37d7e497388cb5da (diff) | |
download | webtools.sourceediting-1852efaf932c33dd4e0069b8160111b821137eca.tar.gz webtools.sourceediting-1852efaf932c33dd4e0069b8160111b821137eca.tar.xz webtools.sourceediting-1852efaf932c33dd4e0069b8160111b821137eca.zip |
Bug fixes for JSP region errors.
Diffstat (limited to 'bundles/org.eclipse.wst.jsdt.web.ui/src/org')
-rw-r--r-- | bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java index 8171846e05..a81007a03a 100644 --- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java +++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java @@ -85,6 +85,8 @@ public class FormattingStrategyJSDT extends ContextBasedFormattingStrategy { int javaLength = partition.getLength(); TextEdit edit = CodeFormatterUtil.format2(CodeFormatter.K_COMPILATION_UNIT, cuSource, javaStart, javaLength, startIndentLevel, TextUtilities.getDefaultLineDelimiter(document), getPreferences()); IDocument doc = new Document(translation.getJsText()); + /* error formating the code so abort */ + if(edit==null) return; edit.apply(doc); String replaceText = TextUtilities.getDefaultLineDelimiter(document) + getIndentationString(getPreferences(), startIndentLevel) + (doc.get(edit.getOffset(), edit.getLength())).trim() + TextUtilities.getDefaultLineDelimiter(document); /* |