Skip to content

Commit

Permalink
Fix script overwriting with external editor
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbdev committed Aug 23, 2024
1 parent 568589c commit 23927c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions editor/plugins/script_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2711,9 +2711,11 @@ void ScriptEditor::apply_scripts() const {
}

void ScriptEditor::reload_scripts(bool p_refresh_only) {
if (external_editor_active) {
return;
}
// Call deferred to make sure it runs on the main thread.
callable_mp(this, &ScriptEditor::_reload_scripts).call_deferred(p_refresh_only);
}

void ScriptEditor::_reload_scripts(bool p_refresh_only) {
for (int i = 0; i < tab_container->get_tab_count(); i++) {
ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control(i));
if (!se) {
Expand Down
1 change: 1 addition & 0 deletions editor/plugins/script_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ class ScriptEditor : public PanelContainer {
void _file_removed(const String &p_file);
void _autosave_scripts();
void _update_autosave_timer();
void _reload_scripts(bool p_refresh_only = false);

void _update_members_overview_visibility();
void _update_members_overview();
Expand Down

0 comments on commit 23927c3

Please sign in to comment.