Skip to content

Commit

Permalink
Merge pull request #40929 from KoBeWi/starhack
Browse files Browse the repository at this point in the history
Properly disambiguate unsaved scripts
  • Loading branch information
akien-mga authored Jul 31, 2020
2 parents be43560 + 3082def commit 5af5331
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions editor/plugins/script_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,14 +1922,18 @@ void ScriptEditor::_update_script_names() {
Vector<String> disambiguated_script_names;
Vector<String> full_script_paths;
for (int j = 0; j < sedata.size(); j++) {
disambiguated_script_names.append(sedata[j].name);
disambiguated_script_names.append(sedata[j].name.replace("(*)", ""));
full_script_paths.append(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<EditorHelp>(tab_container->get_child(i));
Expand Down

0 comments on commit 5af5331

Please sign in to comment.