diff options
author | nsandonato | 2009-05-27 15:42:10 +0000 |
---|---|---|
committer | nsandonato | 2009-05-27 15:42:10 +0000 |
commit | 08564c4f300814b9a263c949dce52069a9c57972 (patch) | |
tree | e23febdb79e0105fb30b1940944f16112fe7ede7 /bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css | |
parent | b4955f894649d3c305f654e11f73f48c71307b0f (diff) | |
download | webtools.sourceediting-08564c4f300814b9a263c949dce52069a9c57972.tar.gz webtools.sourceediting-08564c4f300814b9a263c949dce52069a9c57972.tar.xz webtools.sourceediting-08564c4f300814b9a263c949dce52069a9c57972.zip |
[252983] StructuredTextViewer.exception.verifyText when hitting Enter in CSS document
Diffstat (limited to 'bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css')
-rw-r--r-- | bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java index 531b0ca80e..a3c71b8eb7 100644 --- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java +++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java @@ -36,6 +36,7 @@ public class StructuredAutoEditStrategyCSS implements IAutoEditStrategy { class CompoundRegion { + /* textRegion can be null if the offset is at the end of the document */ CompoundRegion(IStructuredDocumentRegion documentRegion, ITextRegion textRegion) { super(); this.documentRegion = documentRegion; @@ -51,27 +52,27 @@ public class StructuredAutoEditStrategyCSS implements IAutoEditStrategy { } int getStart() { - return textRegion.getStart(); + return (textRegion != null) ? textRegion.getStart() : documentRegion.getStart(); } int getEnd() { - return textRegion.getEnd(); + return (textRegion != null) ? textRegion.getEnd() : documentRegion.getEnd(); } String getType() { - return textRegion.getType(); + return (textRegion != null) ? textRegion.getType() : CSSRegionContexts.CSS_UNKNOWN; } String getText() { - return documentRegion.getText(textRegion); + return (textRegion != null) ? documentRegion.getText(textRegion) : ""; //$NON-NLS-1$ } int getStartOffset() { - return documentRegion.getStartOffset(textRegion); + return (textRegion != null) ? documentRegion.getStartOffset(textRegion) : documentRegion.getStartOffset(); } int getEndOffset() { - return documentRegion.getEndOffset(textRegion); + return (textRegion != null) ? documentRegion.getEndOffset(textRegion) : documentRegion.getEndOffset(); } private IStructuredDocumentRegion documentRegion; |