Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming scripts that are currently open creates duplicate tab in script editor #27635

Open
Jayman2000 opened this issue Apr 3, 2019 · 2 comments

Comments

@Jayman2000
Copy link
Contributor

Jayman2000 commented Apr 3, 2019

Godot version:
v3.1.stable.official

OS/device including version:
Kubuntu 18.10 x64

Issue description:
If there is a script currently open in the script editor, and that script is renamed using the file system panel, then a tab with a blank name will be added to the script editor. If a scene is run while one or more of these blank tabs is open, then the engine will report errors. The errors do not seem to have any negative side effects, other than polluting the bottom panel's output tab.

I would not expect any of that to happen. I would expect renaming the script file to not add an extra tab to the script editor, and I would not expect that tab to cause errors when a scene is being run.

Steps to reproduce:

  1. Open a scene which has at least one node with a script attached to it (Scene.tscn in minimal reproduction project).
  2. Make sure the attached script (Script.gd) is open in the script editor.
  3. Using the file system panel, rename the script to "Test.gd". The error "Another resource is loaded from path: res://Test.gd (possible cyclic resource inclusion)" will appear in the bottom panel's output tab.
  4. There should now be two tabs open in the script editor both with the same contents. One will be called "Test.gd", and one will have a blank name. Repeating step 3 with different names for the script (e.g., "TestA.gd", "TestB.gd",
    Script Rename Bug.zip
    "foobar.gd") will add more tabs with blank names.
  5. Play the current scene. The error message "editor/plugins/script_editor_plugin.cpp:1427 - Condition ' base.begins_with("local://") || base == "" ' is true. Continuing..:" will appear in the bottom panel's output tab once for each blank tab that is currently open in the script editor.

Workaround:
Do not rename scripts that are currently open in the script editor, or simply close out of the blank tabs immediately after renaming a script.

Minimal reproduction project:
Script Rename Bug.zip

@Zylann
Copy link
Contributor

Zylann commented Dec 6, 2019

Still happens in Godot 3.2 beta2.

The following also gets logged:

ERROR: Another resource is loaded from path 'res://unsaved_changes_dialog.gd' (possible cyclic resource inclusion).
   At: core/resource.cpp:78

@Xrayez
Copy link
Contributor

Xrayez commented Jul 23, 2020

See my failed attempts in #40634, which does fix this issue but introduce other errors (or so it seems), perhaps you can figure out what makes it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants