-
Notifications
You must be signed in to change notification settings - Fork 590
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
Geany 2.0: indendation ignored #3721
Comments
It seems one can avoid having it insert tabs by setting auto-indent mode to None, but then when pressing tabs it will still insert tabs instead of spaces despite "Tab key indents". Maybe automated testcases could ensure the most basic functionality won't break again in the future? |
What is inserted for indentation is set in The values for those two settings are set on loading a file to the value in preferences or project properties which overrides the preferences if a project is open. Both of those have a |
I see, this makes sense, thank you for clarifying! I wasn't aware this can be set on a per-file basis and that this can contradict what is specified in the settings and lead to inconsistent behavior of sometimes spaces and sometimes tabs being inserted by Geany. This was indeed the cause of the issue. |
When using 2.0 on Windows the indentation I have set in |
@willbprog127 do you have a project open? It has indentation settings which override the default preference. |
No, no project open. I know from the past that this setting is 'tricky' although it really shouldn't be. Geany is a great editor / IDE, it's just little things like this that make it frustrating to use when setting up on a new system. |
I guess in retrospect the real story is that file preference should not override global settings in the first place unless the user has explicitly changed it for the particular file. It is just confusing and strange behavior that the settings can have no effect when file-based defaults do not agree. And do people actually use that feature? Or is it like in Gimp that one can change toolbox layout etc. but in 99% of cases it just happens by accident to annoy the user? :) |
Indentation is stupidly complex, everyone should use my standard, 4 spaces 😀 But sadly thats not the case, in languages like Python indentation sets program structure, so Python really should use spaces and it defines tab as 8 spaces for where they are mixed, Geany is C which doesn't care, but the devs do and decree tabs but 4 space width, GNU uses two spaces IIRC, other projects use other rules. So it varies by project, by filetype, and needs a default for new files. So Geany has all three, with filetype file indentation settings (if present) overriding default in the preferences, and project overriding both filetype and default (IIRC, I didn't check). But that doesn't handle the user opening a random file from somewhere else, so they need to be able to select the indentation setting manually, and have that override everything, and stick (at least as long as the file is open, and across Geany restarts). But that can be quite a pain, so there is an option to try to detect the indentation from the file when its opened, but its a heuristic, and as such can be wrong, so the manual override is still needed. |
When working with Python files Geany ignores indentation settings and sometimes inserts tabs even when configured with the saner spaces choice (which should be the default actually anyway) particularly after pressing enter after any ":" like after if and while constructs in Python.
This makes it essentially not very useful for such programming tasks as the indentation will constantly be messed up.
I recall this setting was always a bit of a pain in Geany and needed program restarts to be applied, but previously at least it worked after restart, now its behavior is inconsistent.
Version used: geany-2.0_osx_arm64.dmg
The text was updated successfully, but these errors were encountered: