mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-149712 Change widen-selection (ctrl-w) behaviour for a class or method with a comment
This commit is contained in:
+5
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,8 +40,7 @@ public class MethodOrClassSelectioner extends BasicSelectioner {
|
||||
|
||||
@Override
|
||||
public List<TextRange> select(PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) {
|
||||
List<TextRange> result = ContainerUtil.newArrayList(e.getTextRange());
|
||||
result.addAll(expandToWholeLinesWithBlanks(editorText, e.getTextRange()));
|
||||
List<TextRange> result = ContainerUtil.newArrayList();
|
||||
|
||||
PsiElement firstChild = e.getFirstChild();
|
||||
PsiElement[] children = e.getChildren();
|
||||
@@ -77,6 +76,9 @@ public class MethodOrClassSelectioner extends BasicSelectioner {
|
||||
result.addAll(expandToWholeLinesWithBlanks(editorText, range));
|
||||
}
|
||||
|
||||
result.add(e.getTextRange());
|
||||
result.addAll(expandToWholeLinesWithBlanks(editorText, e.getTextRange()));
|
||||
|
||||
if (e instanceof PsiClass) {
|
||||
result.addAll(selectWithTypeParameters((PsiClass)e));
|
||||
result.addAll(selectBetweenBracesLines(children, editorText));
|
||||
|
||||
Reference in New Issue
Block a user