Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Allow symbol renaming only when caret is visible

kobewif87b8bd0a0f7
diff --git a/editor/script/script_text_editor.cpp b/editor/script/script_text_editor.cpp
index eec3d66c2ec..ad29c674882 100644
--- a/editor/script/script_text_editor.cpp
+++ b/editor/script/script_text_editor.cpp
@@ -1667,6 +1667,11 @@ void ScriptTextEditor::shortcut_input(const Ref<InputEvent> &p_event) {
return;
}
+ Control *focus_owner = get_viewport()->gui_get_focus_owner();
+ if (!(focus_owner && (this == focus_owner || is_ancestor_of(focus_owner)))) {
+ return;
+ }
+
if (ED_IS_SHORTCUT("script_text_editor/rename_symbol", p_event)) {
_edit_option(RENAME_SYMBOL);
accept_event();