-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
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
Replacing a variable's name with "replace in files" causes some of the code I wrote before to disappear #91406
Comments
When you say CTRL+ALT+F, do you mean "Replace in Files"? Because that is bound to CTRL+SHIFT+R by default, with CTRL+ALT+F bringing up the "Jump to Function" modal, which doesn't seem to allow for any replacements. Regardless, I was able to reproduce the issue with "Replace in Files". As the name implies, it looks for the provided text in the actual source files, while "Replace" looks at the contents of the text editor. This means that any replacement done with "Replace in Files" is going to result in a reload request from editor as the file is newer on disk. If you have any unsaved changes in the editor, they will be lost in the reload. Can you confirm that the issue doesn't present itself if you save all changes before executing the replacement routine? |
Yeah, you are right, I mean Ctrl+Shift+F. And I tried what you mentioned, my code won't disappear anymore if I saved the script before I replace something. However, I still wish my script can be saved automatically when I use the replacement function, since last time my code (a lot of code) disappeared, which made me very frustrated! |
You may want to throw your support behind this proposal: godotengine/godot-proposals#9654. |
Tested versions
4.2.2 stable
System information
Windows10
Issue description
When I use the ctrl+alt+F to replace a variable's name, some of the code I wrote before using the replace function in the currently open script disappears directly
Steps to reproduce
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: