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

Hotkey for save does not work for saving current scene when script editor is in focus. #82367

Closed
tokengamedev opened this issue Sep 26, 2023 · 7 comments

Comments

@tokengamedev
Copy link

Godot version

4.2.dev.5

System information

Windows 11

Issue description

When you have a scene open with some export variables and script editor is active. If the scene is modified by modifying the export variables in the inspector. Pressing Ctrl + S will not save the scene, when the focus and cursor active in script editor.

This is working fine in 4.1.1

This may have been solved by a PR I don't remember. Raised to make sure the issue is addressed.

Steps to reproduce

  • Open a scene with an export variable and a script attached.
  • Switch to the script editor.
  • Modify the export variables so that scene is modified.
  • Now focus on the script editor by clicking inside the script editor (Important Step)
  • Now press Ctrl + S
    Expected the scene and any changes in the script is saved.
    It will not.

Minimal reproduction project

Not Applicable

@AThousandShips AThousandShips marked this as a duplicate of #78672 Sep 26, 2023
@AThousandShips AThousandShips marked this as not a duplicate of #78672 Sep 26, 2023
@AThousandShips
Copy link
Member

AThousandShips commented Sep 26, 2023

My bad wrong duplicate, but duplicate, finding the correct issue

Edit: might not be, but will look further

@AThousandShips
Copy link
Member

AThousandShips commented Sep 26, 2023

This is a case of a contextual shortcut, see #79337

When inside the script editor the script editor has focus, by design, so that you can save a script instead of a scene

To work around this if you like you can add a shortcut for save scene, under Editor > Save Scene

The shortcut was changed because it was felt that most people would expect Ctrl-S to save what you are currently focused on, you can swap this behavior but this was done to normalize behavior as it is generally expected

@mieldepoche
Copy link
Contributor

  • Editor > Save Scene is Ctrl + S by default.
  • Script Editor > Save was apparently modified to Ctrl + S by default in 4.2, which takes over the save scene shortcut I assume, so to get the old behavior back you have to change it back to what it was: Ctrl + Alt + S (or any other thing).

As a long time user, stumbling upon this was really frustrating. It can be easily worked around though but I don't really have a usecase for saving the script alone and not the currently modified scene.

@AThousandShips
Copy link
Member

The previous behaviour was because of a limitation:

Makes sense to me. The only reason why this setting differed from the Save Scene one is because before 4.0, we didn't support shortcut contexts.

@tokengamedev
Copy link
Author

So if I understand correctly, if I Ctrl +S outside script editor the script should not be saved. because contextually they are different now.

@tokengamedev
Copy link
Author

Let me know if that is the case, then I will raise a bug again.

@tokengamedev
Copy link
Author

Script Editor > Save was apparently modified to Ctrl + S by default in 4.2, which takes over the save scene shortcut I assume, so to get the old behavior back you have to change it back to what it was: Ctrl + Alt + S (or any other thing).

Thanks, you are life saver. I did change and it worked fine.

Closing this issue as this is a default value change as mentioned in #79337

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

4 participants