summaryrefslogtreecommitdiff
path: root/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-10 10:36:39 +0200
committerGitHub <noreply@github.com>2020-07-10 10:36:39 +0200
commitda4851a9defe230e427d04c7e3c0aef714a40bff (patch)
tree79e77e06c2095604893df0f7ab9b5c28e2a73ec3 /editor/plugins/script_editor_plugin.cpp
parent1282b8201fc22782e6566f080a030e1682b3778e (diff)
parentd6c979d91b6753866400cf8824fc14b0bf58a3a8 (diff)
Merge pull request #40198 from DanielZTing/master
Do not try to save internal scripts
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r--editor/plugins/script_editor_plugin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 66f0155c6a..8386d44e69 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -537,11 +537,14 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) {
ScriptEditorBase *current = Object::cast_to<ScriptEditorBase>(tab_container->get_child(selected));
if (current) {
+ Ref<Script> script = current->get_edited_resource();
if (p_save) {
- _menu_option(FILE_SAVE);
+ // Do not try to save internal scripts
+ if (!(script->get_path() == "" || script->get_path().find("local://") != -1 || script->get_path().find("::") != -1)) {
+ _menu_option(FILE_SAVE);
+ }
}
- Ref<Script> script = current->get_edited_resource();
if (script != nullptr) {
previous_scripts.push_back(script->get_path());
notify_script_close(script);