summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-02-06 11:27:16 +0100
committerGitHub <noreply@github.com>2019-02-06 11:27:16 +0100
commit25027d60f7fb665d2d82f964f1c4f7927fe15cc7 (patch)
tree2b2342b26378bbacbb1cccc651711dd3e9a72781
parent6afc024078eaaf66a8542d8977737ebd927e163f (diff)
parent69374cd3781d900cddffda725b1ff4629cb688c1 (diff)
Merge pull request #25606 from Paulb23/fix_textedit_scroll_selection
Fixed selection being activated when using scroll lines.
-rw-r--r--scene/gui/text_edit.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 09fbb39866..4abde6cc0f 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2645,24 +2645,26 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
}
case KEY_UP: {
- if (k->get_shift())
- _pre_shift_selection();
if (k->get_alt()) {
scancode_handled = false;
break;
}
#ifndef APPLE_STYLE_KEYS
if (k->get_command()) {
- _scroll_lines_up();
- break;
- }
#else
if (k->get_command() && k->get_alt()) {
+#endif
_scroll_lines_up();
break;
}
+ if (k->get_shift()) {
+ _pre_shift_selection();
+ }
+
+#ifdef APPLE_STYLE_KEYS
if (k->get_command()) {
+
cursor_set_line(0);
} else
#endif
@@ -2696,24 +2698,24 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
}
case KEY_DOWN: {
- if (k->get_shift())
- _pre_shift_selection();
if (k->get_alt()) {
scancode_handled = false;
break;
}
#ifndef APPLE_STYLE_KEYS
if (k->get_command()) {
- _scroll_lines_down();
- break;
- }
-
#else
if (k->get_command() && k->get_alt()) {
+#endif
_scroll_lines_down();
break;
}
+ if (k->get_shift()) {
+ _pre_shift_selection();
+ }
+
+#ifdef APPLE_STYLE_KEYS
if (k->get_command()) {
cursor_set_line(get_last_unhidden_line(), true, false, 9999);
} else