From cea16907bb8df7070a8e127077544ccda56e9da3 Mon Sep 17 00:00:00 2001 From: Tomasz Chabora Date: Fri, 31 Jul 2020 22:43:40 +0200 Subject: [PATCH] Properly disambiguate unsaved scripts (cherry picked from commit 3082def404091bce1acaa53226c514d105ddf8d1) --- editor/plugins/script_editor_plugin.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 579ea389c64..32c9ca19989 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1892,14 +1892,18 @@ void ScriptEditor::_update_script_names() { Vector disambiguated_script_names; Vector full_script_paths; for (int j = 0; j < sedata.size(); j++) { - disambiguated_script_names.push_back(sedata[j].name); + disambiguated_script_names.push_back(sedata[j].name.replace("(*)", "")); full_script_paths.push_back(sedata[j].tooltip); } EditorNode::disambiguate_filenames(full_script_paths, disambiguated_script_names); for (int j = 0; j < sedata.size(); j++) { - sedata.write[j].name = disambiguated_script_names[j]; + if (sedata[j].name.ends_with("(*)")) { + sedata.write[j].name = disambiguated_script_names[j] + "(*)"; + } else { + sedata.write[j].name = disambiguated_script_names[j]; + } } EditorHelp *eh = Object::cast_to(tab_container->get_child(i));