Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartEditor.java |
=================================================================== |
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartEditor.java (revision 24253) |
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartEditor.java (working copy) |
@@ -130,6 +130,7 @@ |
import org.eclipse.jface.text.ITextViewer; |
import org.eclipse.jface.text.ITextViewerExtension2; |
import org.eclipse.jface.text.ITextViewerExtension5; |
+import org.eclipse.jface.text.MarkSelection; |
import org.eclipse.jface.text.Position; |
import org.eclipse.jface.text.Region; |
import org.eclipse.jface.text.TextSelection; |
@@ -1485,6 +1486,11 @@ |
if (selection == null) { |
return new DartSelection(DartEditor.this, null, -1, 0); |
} |
+ if (selection instanceof MarkSelection) { |
+ MarkSelection sel = (MarkSelection) selection; |
+ IDocument doc = sel.getDocument(); |
+ return new DartSelection(DartEditor.this, doc, sel.getOffset(), sel.getLength()); |
+ } |
ITextSelection textSelection = (ITextSelection) selection; |
// prepare document |
ISourceViewer sourceViewer = getSourceViewer(); |