mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-184219 New selection doesn't start from within existing selection
fix CreateRectangularSelection action
This commit is contained in:
@@ -3814,7 +3814,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!myMousePressedInsideSelectionForDrag && getSelectionModel().hasSelection()) {
|
||||
if (!myMousePressedInsideSelectionForDrag && getSelectionModel().hasSelection() && !isCreateRectangularSelectionEvent(e)) {
|
||||
setMouseSelectionState(MOUSE_SELECTION_STATE_NONE);
|
||||
mySelectionModel.setSelection(caretOffset, caretOffset);
|
||||
}
|
||||
|
||||
@@ -549,4 +549,11 @@ public class EditorImplTest extends AbstractEditorTest {
|
||||
mouse.release();
|
||||
checkResultByText("a<selection>bcd<caret></selection>ef");
|
||||
}
|
||||
|
||||
public void testCreateRectangularSelectionWithDndDisabled() {
|
||||
initText("ab\ncd<caret>");
|
||||
myEditor.getSettings().setDndEnabled(false);
|
||||
mouse().alt().shift().middle().clickAt(0, 0);
|
||||
checkResultByText("<selection><caret>ab</selection>\n<selection><caret>cd</selection>");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user