summaryrefslogtreecommitdiffstats
path: root/editor/plugins/text_editor.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-31 11:07:48 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-10-31 11:07:48 +0100
commit49c53027a9e4ada8e75a8b18e19f8e9462ca6dcd (patch)
treef184f64d62b1d306c0daaadd28494b7739f669b2 /editor/plugins/text_editor.cpp
parent3312d0a87bd81d3e656ce0a12d9109837b140ab6 (diff)
parentd499071e5b448a11fb3e815c33ab55cd4c23b5c1 (diff)
downloadredot-engine-49c53027a9e4ada8e75a8b18e19f8e9462ca6dcd.tar.gz
Merge pull request #67786 from EricEzaM/67743-script-editor-shortcuts
Set the shortcut context for the edit/search/goto menus to the ScriptEditor so that shortcuts continue to work when FindReplaceBar is focused.
Diffstat (limited to 'editor/plugins/text_editor.cpp')
-rw-r--r--editor/plugins/text_editor.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index 07f0819c7f..0c12b03447 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -108,7 +108,7 @@ void TextEditor::set_edited_resource(const Ref<Resource> &p_res) {
code_editor->update_line_and_column();
}
-void TextEditor::enable_editor() {
+void TextEditor::enable_editor(Control *p_shortcut_context) {
if (editor_enabled) {
return;
}
@@ -116,6 +116,15 @@ void TextEditor::enable_editor() {
editor_enabled = true;
_load_theme_settings();
+
+ if (p_shortcut_context) {
+ for (int i = 0; i < edit_hb->get_child_count(); ++i) {
+ Control *c = cast_to<Control>(edit_hb->get_child(i));
+ if (c) {
+ c->set_shortcut_context(p_shortcut_context);
+ }
+ }
+ }
}
void TextEditor::add_callback(const String &p_function, PackedStringArray p_args) {