-
-
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
.gd files changed unexpectedly on running a project #56510
Comments
This happens because Godot's default Editor Settings are:
So it automatically converts 4 spaces to one tab. You can solve it by disabling |
@Paulb23 Do you think we could make Convert Indent on Save cleverer in such cases to avoid breakage? Or should we disable it by default (and maybe add a "Strip Trailing Whitespace" instead that could be enabled by default). Also related: godotengine/godot-proposals#3525, which would make Convert Indent on Save mostly irrelevant (never got to finish my implementation) |
This option already exists, but it's disabled by default. Enabling it by default makes sense, but it can reduce productivity due to it always trimming whitespace on the line the cursor is currently on. See also godotengine/godot-proposals#3229. |
Just got bitten by this after upgrading to 3.5 from 3.4.5... |
Adding to this issue, this is breaking .github/workflows/*.yml files when saving / reloading / opening projects. The yml indentation is broken by godot as it doesn't not allow you to select "preserve original", it's only spaces or tabs. Additionally this would be a lot easier to handle if we had a "ignore files of type: x,y,z" where you can instruct godot on a project base to ignore files of X types completely. |
Godot version
3.4.2
System information
Windows 10 GLES3
Issue description
I'm learning Godot and I downloaded an example project from GitHub
https://github.com/CadanoX/Godot-Slot-Machine
After I run it it gives me the error: "mixed tabs and spacing in indentation." And it does not start.
I see that the original files from GitHub are indented using spaces only.
When I RUN the project it seems that Godot adds some tabs under the ifs autonomously.
I think that a program don't have the rights to change files autonomously but only to give errors if the file is not correct..
Steps to reproduce
1)Download the Github project as a zip
https://github.com/CadanoX/Godot-Slot-Machine
2)Open SlotMachine.gd with notepad++ and enable "display Spaces and tabulations"
As you can see the file is paced indented only, leave it opened
3) Import the project in godot
4) Run it
5) Project don't start but gives "Mixed tabs and spacing in indentation" error
6) Notepad++ states that the files have been modified and ask to reload it
7) Reload the file and you can see that Godot modified the file..
According to me Godot should only tell the User that something is wrong but should not touch the files on loading.
I tried fixing the files but Godot keeps changing them. It only likes tabs indentation and in that case it leaves them untouched..
Minimal reproduction project
https://github.com/CadanoX/Godot-Slot-Machine
The text was updated successfully, but these errors were encountered: