Browse Source

Allow using Enter key for replacing text in code editors (also Shift + Enter works backwards)

Fixes issue #31762
Dominik 'squ@ll' Jasiński 5 years ago
parent
commit
1adcd57377
1 changed files with 5 additions and 0 deletions
  1. 5 0
      editor/code_editor.cpp

+ 5 - 0
editor/code_editor.cpp

@@ -517,6 +517,11 @@ void FindReplaceBar::_replace_text_entered(const String &p_text) {
 	if (selection_only->is_pressed() && text_edit->is_selection_active()) {
 	if (selection_only->is_pressed() && text_edit->is_selection_active()) {
 		_replace_all();
 		_replace_all();
 		_hide_bar();
 		_hide_bar();
+	} else if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
+		_replace();
+		search_prev();
+	} else {
+		_replace();
 	}
 	}
 }
 }