RegExp: only skip regular chars not escapes in word selection filter

This commit is contained in:
Bas Leijdekkers
2017-02-09 14:39:46 +01:00
parent 770b3e9833
commit 2cdd27a605
@@ -19,7 +19,6 @@ import com.intellij.lang.ASTNode;
import com.intellij.openapi.util.Condition;
import com.intellij.psi.PsiElement;
import org.intellij.lang.regexp.psi.RegExpChar;
import org.intellij.lang.regexp.psi.RegExpNamedCharacter;
import org.jetbrains.annotations.NotNull;
/**
@@ -30,7 +29,7 @@ public class RegExpWordSelectionFilter implements Condition<PsiElement> {
public boolean value(@NotNull PsiElement element) {
final ASTNode node = element.getNode();
if ((node != null && node.getElementType() == RegExpTT.CHARACTER) ||
(element instanceof RegExpChar && !(element instanceof RegExpNamedCharacter))) {
(element instanceof RegExpChar && ((RegExpChar)element).getType() == RegExpChar.Type.CHAR)) {
return false;
}
return true;