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

script editor saving when should not #68802

Closed
dmaz opened this issue Nov 17, 2022 · 3 comments
Closed

script editor saving when should not #68802

dmaz opened this issue Nov 17, 2022 · 3 comments

Comments

@dmaz
Copy link
Contributor

dmaz commented Nov 17, 2022

Godot version

v4.0.beta.custom_build [49cc12b]

System information

Windows 10

Issue description

the script editor saves even when it should not. this may or may not be related to #68795 but I've only just noticed it since I started getting that issue.

Text Editor/ Behavior/ Autosave Interval = 0
Interface/ Editor/ Save On Focus Lost = off
Run/ Auto Save = on

if I make a change to code and then close the editor it will save that change even though it should not. I don't have an issue with an autosave happening in the background for recovery in the case of crashes. but it should not write those changes to the actual file. as of the the most recent build this issue seems to lead to the issue listed above when reopening the file. and can get even a little more messy when the change wasn't compilable code.

Steps to reproduce

  • open the editor
  • make sure auto save settings don't auto save...
  • make a code change
  • close the editor without saving ( I generally don't even get prompted to save the code change)
  • open the editor and the file... if you don't have a blank file (re issue linked above) you should see the changes you made but did not save

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Nov 17, 2022

This is likely because editor state is preserved across sessions (such as scrolling position), and this includes the file's contents.

cc @Paulb23

@dmaz
Copy link
Contributor Author

dmaz commented Nov 17, 2022

ah... ok but should it really do that without any kind of notification? I would expect a prompt asking if you want to save or not. and isn't that inconsistent with other editors like the scene editor.

it's a quirk I could get used if there were some kind of indicators that there are unsaved changes. vscode saves the session like that but it also clearly shows which files have unsaved changes (not to mention it also has gutter diffs vs git.)

actaully that brings up another new issue... horizontal scroll position gets set wrong in the editor sometimes. sometimes after I reopen the editor a few of my files will have the horizontal scroll in a position other than 0 and other than what it was last at.

[edit]
so... if this is not a bug then and just needs feature change then closing it is fine with me. as I mostly only noticed it because of the issue linked above

@KoBeWi
Copy link
Member

KoBeWi commented Nov 17, 2022

Duplicate of #18010

@KoBeWi KoBeWi marked this as a duplicate of #18010 Nov 17, 2022
@KoBeWi KoBeWi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants