diff options
| author | kobewi <kobewi4e@gmail.com> | 2021-06-24 15:38:29 +0200 |
|---|---|---|
| committer | kobewi <kobewi4e@gmail.com> | 2021-06-24 15:38:29 +0200 |
| commit | 35a38717e20fbb4e35c82fbab21b14e60b5dc516 (patch) | |
| tree | 99b67242b1ce0c4e7cbab518264a9252cecdd490 /editor/plugins/script_editor_plugin.cpp | |
| parent | d36b220531198b494fc309c015e04867926992fd (diff) | |
| download | redot-engine-35a38717e20fbb4e35c82fbab21b14e60b5dc516.tar.gz | |
Fix crash with FindReplaceBar
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
| -rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 0410ab3a45..dfd2b2c2ff 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -760,6 +760,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { _update_members_overview_visibility(); _update_help_overview_visibility(); _save_layout(); + _update_find_replace_bar(); } void ScriptEditor::_close_current_tab(bool p_save) { @@ -829,6 +830,7 @@ void ScriptEditor::_close_all_tabs() { _close_current_tab(false); } + _update_find_replace_bar(); } void ScriptEditor::_ask_close_current_unsaved_tab(ScriptEditorBase *current) { @@ -1640,15 +1642,13 @@ void ScriptEditor::ensure_select_current() { ScriptEditorBase *se = _get_current_editor(); if (se) { se->enable_editor(); - se->set_find_replace_bar(find_replace_bar); if (!grab_focus_block && is_visible_in_tree()) { se->ensure_focus(); } - } else { - find_replace_bar->hide(); } } + _update_find_replace_bar(); _update_selected_editor_menu(); } @@ -2520,6 +2520,16 @@ void ScriptEditor::_file_removed(const String &p_removed_file) { } } +void ScriptEditor::_update_find_replace_bar() { + ScriptEditorBase *se = _get_current_editor(); + if (se) { + se->set_find_replace_bar(find_replace_bar); + } else { + find_replace_bar->set_text_edit(nullptr); + find_replace_bar->hide(); + } +} + void ScriptEditor::_autosave_scripts() { save_all_scripts(); } |
