-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Closing a gdscript in the editor, choosing "Discard" and immediately re-opening it, shows old discarded content #50578
Comments
Bump, because it's rather serious IMHO. |
I think this has to do with the editor changing the Script resource even before you save. So when you close the editor and then load the Script again, it uses the Script resource that's already loaded (with the changes). Is there a way to remove the changes made to a Script? |
This is part of a larger issue: if you change a resource in the editor (scene editor or resource inspector), discard the changes, and then reload the resource that you changed (or the scene with the resource), then the changes will still be present. Something is holding onto these resources and preventing them from being freed. Strangely, this doesn't apply to Scenes, just the resources contained within. |
@Hakunamawatta Changing e.g. a Theme resource never prompts for a discard when you switch to another resource. So we may accept that this is how it works in Godot, with resources. Which is rather bad but may be addressed in another issue. |
Choosing "discard" for scenes does not work entirely: as I mentioned, the changes made to Resources within those scenes remain after changes to a scene are discarded, even if the Resource is built-in. I think this issue is related to the issue of Scripts because Scripts are also Resources. |
Never mind. It seems like it's an unrelated issue that's not present in 4.0 whereas the Script issue is still in 4.0. |
Interestingly closing with Ctrl+W works fine for me! Specifically closing via context menu have issue. |
Godot version
3.3.2.stable.official
System information
Ubuntu
Issue description
Closing a gdscript in the editor and choosing "Discard" and then immediately re-opening it, actually loads its last state, while not actually saving the changes on file (at least).
This is very dangerous because it can lead to loose massive amounts of coding, especially if one does not know that the actual file has not been actually overwritten with the discarded content.
Steps to reproduce
Update: having multiple scripts opened may not be needed to reproduce the bug.
Minimal reproduction project
DiscardScriptBug.zip
The text was updated successfully, but these errors were encountered: