From a1388dff7e7226bdf7624300f62eae260e7e7da4 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 6 Apr 2019 01:19:00 +0200 Subject: [PATCH] Find the previous match in script editor when pressing Shift + Enter This allows cycling through matches more efficiently. (cherry picked from commit 8a1c5a839090a26e6c859c3f09ba1274540eff9d) --- editor/code_editor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 7ee4d5b03b..43c60afcd8 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -30,6 +30,7 @@ #include "code_editor.h" +#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/string_builder.h" #include "editor/editor_scale.h" @@ -432,7 +433,11 @@ void FindReplaceBar::_search_text_changed(const String &p_text) { void FindReplaceBar::_search_text_entered(const String &p_text) { - search_next(); + if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + search_prev(); + } else { + search_next(); + } } void FindReplaceBar::_replace_text_entered(const String &p_text) {