-
Notifications
You must be signed in to change notification settings - Fork 619
Indentation auto-detection for python files #1008
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
Comments
The detection width is set by a heuristic based on a "factored most common" and is not language specific. With a heuristic there will always be situations where it will get it wrong. In particular a language like Python tends to have most indents at a multiple of the minimum, so it is likely to be most at risk. The most accurate method would be to make it language dependent, especially for Python where indent is syntax. But that would need support for language specific capabilities to be added via plugins since we do not want to hard code language specific features for all the number of languages we support. That plugin capability has been discussed, but does not exist at the moment. |
I have this problem too. |
Wait no for me its worse and just always does tab indents even when I set it to spaces. |
That sounds like a different issue. |
Yeah when I get home.
May 19, 2025 07:08:20 Enrico Tröger ***@***.***>:
…
[Image]*eht16* left a comment (geany/geany#1008)[#1008 (comment)]
Wait no for me its worse and just always does tab indents even when I set it to spaces.
That sounds like a different issue.
Do you mind opening a new one and describing the problem in more detail with example code to reproduce?
—
Reply to this email directly, view it on GitHub[#1008 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/A3FC6DDC7RDOHEQOM4KKQ2L27DZEJAVCNFSM6AAAAAB5LZA36GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBZGIYTENJSG4].
You are receiving this because you commented.
[Tracking image][https://github.com/notifications/beacon/A3FC6DD535KEDXQHOUME65L27DZEJA5CNFSM6AAAAAB5LZA36GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTVMGXRG6.gif]
|
Uh oh!
There was an error while loading. Please reload this page.
I have "Detect width from file" option checked in preferences. But geany often fails to detect indentation width for some python files, for example:
For this file indentation is set to 8 spaces (should be 4).
Geany 1.27, Arch Linux
The text was updated successfully, but these errors were encountered: