summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorAlfred Reinold Baudisch <alfred@alfredbaudisch.com>2022-11-05 09:37:19 +0100
committerAlfred Reinold Baudisch <alfred@alfredbaudisch.com>2022-11-06 20:03:06 +0100
commit0d2953074b863861fed351c520449d860de72c99 (patch)
tree0a39c9bf5ab9d3aff0bd715679f938d291991357 /scene
parentec521a405a89a1b80a9989c09dcc2f2e7763ddcf (diff)
Mouse click deselect removes secondary carets and puts primary caret under mouse position
Fixes and closes #67993.
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 1b8444abf4..56f7281721 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1854,6 +1854,12 @@ void TextEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
} else {
if (mb->get_button_index() == MouseButton::LEFT) {
if (selection_drag_attempt && is_mouse_over_selection()) {
+ remove_secondary_carets();
+
+ Point2i pos = get_line_column_at_pos(get_local_mouse_pos());
+ set_caret_line(pos.y, false, true, 0, 0);
+ set_caret_column(pos.x, true, 0);
+
deselect();
}
dragging_minimap = false;