Redot-Engine / redot-engine

Redot Engine – Multi-platform 2D and 3D game engine
https://redotengine.org/
MIT License
4.78k stars 214 forks source link

Saving .gd files does not truncate whitespace at EOL #845

Closed stevekonrad closed 1 week ago

stevekonrad commented 2 weeks ago

Tested versions

System information

Windows 10

Issue description

Saving any .gd file does not truncate empty lines if they only consist of whitespace (or whitespace at the end of a line).

Steps to reproduce

Open a .gd script (or create a new one).

  1. empty line:
    • just add some tabs
    • save the file
    • tabs remain in that line
  2. line with code:
    • add some tabs at end of line (behind code)
    • save the file
    • tasb remain at end of line

Minimal reproduction project (MRP)

Just any project with any .gd file really.

EDIT: seems to be affecting project that started in godot. more inconsistency mentioned in comment https://github.com/Redot-Engine/redot-engine/issues/845#issuecomment-2460915093.

stevekonrad commented 2 weeks ago

This seems to be fixed once you changed the setting in the editor-settings (text editor -> behaviour -> trim trailing whitespace on save).

I have yet to test, why the behaviour is initially different between godot and redot.

stevekonrad commented 2 weeks ago

without changing anything in the editor-settings (redot opened the project first, then godot did) redot trims, godot does not image

there is something wrong with this setting for whatever reason... not sure i can make any sense of this behaviour anymore...

feel free to close as changing the setting once, immediately fixes the problem for any future edit (for the project in question at least).

stevekonrad commented 2 weeks ago

exact steps to repro the inconsistency (on my end) versions:

steps:

Spartan322 commented 2 weeks ago

feel free to close as changing the setting once, immediately fixes the problem for any future edit (for the project in question at least).

This is an editor setting, not a project setting, we did not change anything about editor settings, so it shouldn't be anything we've done. And I can't replicate this at all on my side, the setting by default is off and that's what it is on my side.