diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 11:07:48 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 11:07:48 +0100 |
commit | 49c53027a9e4ada8e75a8b18e19f8e9462ca6dcd (patch) | |
tree | f184f64d62b1d306c0daaadd28494b7739f669b2 /editor/plugins/script_text_editor.cpp | |
parent | 3312d0a87bd81d3e656ce0a12d9109837b140ab6 (diff) | |
parent | d499071e5b448a11fb3e815c33ab55cd4c23b5c1 (diff) | |
download | redot-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/script_text_editor.cpp')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 7d7ef9245f..e54a338c09 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -151,7 +151,7 @@ void ScriptTextEditor::set_edited_resource(const Ref<Resource> &p_res) { code_editor->update_line_and_column(); } -void ScriptTextEditor::enable_editor() { +void ScriptTextEditor::enable_editor(Control *p_shortcut_context) { if (editor_enabled) { return; } @@ -161,6 +161,15 @@ void ScriptTextEditor::enable_editor() { _enable_code_editor(); _validate_script(); + + 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 ScriptTextEditor::_load_theme_settings() { |