Author: mareshkau
Date: 2009-02-13 08:16:21 -0500 (Fri, 13 Feb 2009)
New Revision: 13608
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3650
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2009-02-13
07:05:15 UTC (rev 13607)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2009-02-13
13:16:21 UTC (rev 13608)
@@ -15,7 +15,6 @@
import org.eclipse.swt.graphics.Point;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.xml.core.internal.document.NodeImpl;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -254,7 +253,6 @@
final public void refreshVisualSelection() {
IStructuredModel model = null;
-
try {
// checks for null, for case when we close editor and background
// update job is running
@@ -368,9 +366,9 @@
- NodesManagingUtil.getStartOffsetNode(targetSourceNode);
int length = visualNode.getNodeValue().length();
- if (focusOffcetReferenceToSourceNode > length
- || anchorOffcetReferenceToSourceNode > length)
- return;
+// if (focusOffcetReferenceToSourceNode > length
+// || anchorOffcetReferenceToSourceNode > length)
+// return;
NodeImpl sourceTextImpl = (NodeImpl) targetSourceNode;
int visualNodeFocusOffcet = TextUtil.visualPosition(
sourceTextImpl.getValueSource(),
@@ -379,7 +377,9 @@
int visualNodeAnchorOffcet = TextUtil.visualPosition(
sourceTextImpl.getValueSource(),
anchorOffcetReferenceToSourceNode);
-
+ if (visualNodeFocusOffcet > length
+ || visualNodeAnchorOffcet > length)
+ return;
nsISelection selection = selectionController.getSelection(
nsISelectionController.SELECTION_NORMAL);