IDEA-110607 Double clicking space/tab characters should select all space/tab characters until it encounters another type of character

Better `Extend Selection` behavior when some text is already selected

GitOrigin-RevId: ca57c876f49590eb6693b3e1cc7a832e758a88db
This commit is contained in:
Filipp Vakhitov
2023-02-15 19:12:43 +00:00
committed by intellij-monorepo-bot
parent 8a71f62c92
commit dd712b6535
@@ -271,6 +271,8 @@ public final class SelectWordUtil {
* by any side of a caret at specified cursorPosition
*/
public static boolean canWhiteSpaceBeExpanded(PsiWhiteSpace psiWhiteSpace, int cursorPosition, Caret caret) {
if (caret.hasSelection() && psiWhiteSpace.getTextRange().contains(caret.getSelectionRange())) return false;
int beforeOffset = caret.hasSelection()? caret.getSelectionStart() : cursorPosition;
Character charBeforeCursor = getCharBeforeCursorInPsiElement(psiWhiteSpace, beforeOffset);
if (charBeforeCursor != null && isExpandableWhiteSpace(charBeforeCursor)) return true;