Skip to content

fix: detect indentation in source for generating hook code#587

Open
NanobotZ wants to merge 1 commit into
GodotModding:4.x-devfrom
NanobotZ:fix-hooks-indentation
Open

fix: detect indentation in source for generating hook code#587
NanobotZ wants to merge 1 commit into
GodotModding:4.x-devfrom
NanobotZ:fix-hooks-indentation

Conversation

@NanobotZ
Copy link
Copy Markdown

@NanobotZ NanobotZ commented Feb 1, 2026

Added detecting indentation for generating hook code.
Fixes cases when script's source doesn't use single tabs.
Fixes #575

@kyfex-uwu
Copy link
Copy Markdown
Contributor

works for me with the game Ultrapool (uses 4 spaces instead of tabs)

@KANAjetzt KANAjetzt added bug Something isn't working 4.x labels Feb 1, 2026
@KANAjetzt KANAjetzt requested review from KANAjetzt and Qubus0 and removed request for KANAjetzt February 1, 2026 19:58
@KANAjetzt KANAjetzt added this to the 4.x - 7.x milestone Feb 1, 2026
Copy link
Copy Markdown
Member

@KANAjetzt KANAjetzt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@KANAjetzt
Copy link
Copy Markdown
Member

We should add an option that allows developers to set this when integrating the loader, so detection can be skipped if the option is set.

@Ech0klang
Copy link
Copy Markdown

Manually merged this with PR #588 and found it NOT working for a game in a custom version of godot 4.6.
The decompiled version of a script has 5 spaces as indentation, without modification this produced indentation of 1 tab and 5 spaces. I've temporarily "fixed" this for me by overwriting the "Default state" (as set at the end of the modified script)

@NanobotZ
Copy link
Copy Markdown
Author

NanobotZ commented Apr 16, 2026

Manually merged this with PR #588 and found it NOT working for a game in a custom version of godot 4.6. The decompiled version of a script has 5 spaces as indentation, without modification this produced indentation of 1 tab and 5 spaces. I've temporarily "fixed" this for me by overwriting the "Default state" (as set at the end of the modified script)

Could you provide some examples?
I've tested it with some random script text having 5 spaces as indentation, and detected indentation was 5 spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.x bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hook preprocessing spaces vs tabs

4 participants