mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[lang] SelectWordHandler: prefer element on the left if we are at the end of existing selection
Fixes IDEA-339055 `Extend selection` doesn't select qualifier of string templates properly GitOrigin-RevId: 5008dfa9a1f448feda4c588362bde4e16fe6a810
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e663f8c86f
commit
c419f8d3cc
+1
@@ -210,6 +210,7 @@ public abstract class AbstractBasicJavaSelectWordTest extends SelectWordTestBase
|
||||
public void testStringTemplate4() { doTest("java"); }
|
||||
public void testStringTemplate5() { doTest("java"); }
|
||||
public void testStringTemplate6() { doTest("java"); }
|
||||
public void testStringTemplate7() { doTest("java"); }
|
||||
|
||||
public void testLineComments() { doTest("java"); }
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void test() {
|
||||
int i = 1;
|
||||
String sql = <selection>STR."""
|
||||
select * from customer \{i}
|
||||
"""<caret></selection>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void test() {
|
||||
int i = 1;
|
||||
String sql = STR.<selection>"""
|
||||
select * from customer \{i}
|
||||
"""<caret></selection>;
|
||||
}
|
||||
}
|
||||
@@ -205,6 +205,9 @@ public final class SelectWordHandler extends EditorActionHandler.ForEachCaret {
|
||||
if ((caretOffset == text.length() || Character.isWhitespace(text.charAt(caretOffset))) && !Character.isWhitespace(prev)) {
|
||||
return caretOffset - 1;
|
||||
}
|
||||
if (caret.getSelectionEnd() == caretOffset && caret.getSelectionStart() < caretOffset) {
|
||||
return caretOffset - 1;
|
||||
}
|
||||
return caretOffset;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user