-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
One feature the styleguide doesn't seem to directly touch on (only indirectly via examples) is the indentation of empty lines in combination with the "Draw Tabs" setting; this is a feature I find remarkably helpful for visually identifying related/scoped blocks of code while looking through the Godot editor. Without this feature as a formatting option, files can become harder to follow at a glance. Consider this example:
I'm able to trace through the different scopes of the code by glancing at the tab indicators on the left side. After formatting, it becomes:
And now the scopes are visually disconnected and don't read nicely.
Arguably this is more of an issue with the way the GDScript editor presents code, as other IDEs (e.g. VSCode) are capable of grouping up code regardless of the file's actual whitespace. Nonetheless it would be nice to have an option to retain the appropriate level of indentation for blank lines as a partial solution, at least until Godot supports a grouping feature natively.
It's worth mentioning that there is an Indent Guidelines addon for Godot 4.3/4.4 that may partially fix the problem, but that means having another project addon to manage, and I'm not sure if it works for 4.5 yet. I'd much prefer a solution that doesn't require tacking on another addon to the list!