Skip to content

Closing a gdscript in the editor, choosing "Discard" and immediately re-opening it, shows old discarded content #50578

@andrea-calligaris

Description

@andrea-calligaris

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

  • Open the example project, or just create an empty project with at least two gdscripts.
  • Open both scripts in the editor.
  • Change one of the script, then close it, either by using the script list on the left or the context menu.
  • Immediately re-open the script.
  • See that the last state of the content of the script is given to the user, exactly as it was, even though you chose "Discard".

Update: having multiple scripts opened may not be needed to reproduce the bug.

Minimal reproduction project

DiscardScriptBug.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions