From 2e34a922f04939192e3cd45a5d27ecfcec2048c1 Mon Sep 17 00:00:00 2001 From: Thomas ten Cate Date: Fri, 10 Aug 2018 11:23:13 +0200 Subject: [PATCH] Reset caret blink when Ctrl+moving the cursor There was a hardcoded exception to never reset caret blinking if Ctrl (`command`) was pressed. This broke on Ctrl+arrows, Ctrl+Home/End/PgUp/PgDn, Ctrl+C, Ctrl+V, Ctrl+Backspace and Ctrl+Delete. Resetting blink only for those Ctrl operations that actually touch the cursor somehow would clutter the code a lot, so I removed the check entirely. That means we now also reset blinking on unrelated operations like Ctrl+O, but that seems pretty harmless. I actually like the additional bit of feedback even in that case (most of these will immediately defocus the editor anyway, so you never see it). Fixes #18100 (cherry picked from commit 44d761e55cfd185b08081936979c9b89f593ecf7) --- scene/gui/text_edit.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index c7df86a4b86..273c3209e9a 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2277,9 +2277,7 @@ void TextEdit::_gui_input(const Ref &p_gui_input) { k->set_shift(false); } - if (!k->get_command()) { - _reset_caret_blink_timer(); - } + _reset_caret_blink_timer(); // save here for insert mode, just in case it is cleared in the following section bool had_selection = selection.active;