Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornsandonato2009-10-20 18:57:31 +0000
committernsandonato2009-10-20 18:57:31 +0000
commitea7a9b93caa084f26824a270c2e713a44a76fad9 (patch)
tree23121c621daed7df3588a5b7fb7ae7406fba288c /bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css
parente7e0943dd9b2f18c495484870b9eafbf6f500d88 (diff)
downloadwebtools.sourceediting-ea7a9b93caa084f26824a270c2e713a44a76fad9.tar.gz
webtools.sourceediting-ea7a9b93caa084f26824a270c2e713a44a76fad9.tar.xz
webtools.sourceediting-ea7a9b93caa084f26824a270c2e713a44a76fad9.zip
[86427] Expand Selection To... does not expand to entire selector or rule
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/handlers/StructuredSelectEnclosingHandler.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java
index ac19982754..efd4711595 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@ import org.eclipse.jface.text.Region;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredSelectHandler;
+import org.w3c.dom.css.CSSStyleDeclaration;
public class StructuredSelectEnclosingHandler extends AbstractStructuredSelectHandler {
@@ -36,6 +37,9 @@ public class StructuredSelectEnclosingHandler extends AbstractStructuredSelectHa
int currentEndOffset = currentOffset + textSelection.getLength();
if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
ICSSNode newNode = cursorNode.getParentNode();
+ if(newNode instanceof CSSStyleDeclaration) {
+ newNode = newNode.getParentNode();
+ }
if (newNode instanceof IndexedRegion) {
IndexedRegion newIndexedRegion = (IndexedRegion) newNode;

Back to the top