I use shift+tab to unindent, and would prefer that backspace always deletes exactly one character in all contexts, but currently, when the cursor is in what the editor considers indentation, it always unindents rather than deleting a character (except when the indentation is tabs, apparently):
https://github.com/geany/geany/blob/bb45e3b7485e27f29bf652968b9094da322d0bc7...
Can you add a preference to control this "smart" backspace behavior (basically, it would just skip that line of code)?
except when the indentation is tabs, apparently
well deleting one tab _is_ unindenting, so no smarts needed :grin:
If "somebody" makes a good PR it is likely to be accepted.
I'll see if I can figure out the preference UI stuff.
This line has me a bit worried: https://github.com/geany/geany/blob/bb45e3b7485e27f29bf652968b9094da322d0bc7... Project indentation preferences are stored separately, and appear to override editor preferences. The project preferences don't appear to have a checkbox for "tab key indents", currently. Should these even be Indentation preferences, as opposed to Editor Features?
Technically speaking, unindenting when using tabs may do something additional: with spaces, backspace unindenting moves the cursor to the first non-indent character (as does shift+tab, but not ctrl+u).
Looking at `use_tab_to_indent`, that is an editor preference, not an indentation preference, despite being on the indentation tab, so I followed a similar strategy. The implementation seems to be in the `editor_set_indent` function specifically so it can turn itself off when using tabs.
Project indentation preferences are stored separately, and appear to override editor preferences.
Yes when the project has that preference, only some preferences are available for override in projects.
Probably since "Tab key indents" is not overidable by the project its reasonable to say that "Backspace unindents" need not be either. They are not the sort of thing that is project specific, they are user specific, whereas things like if indents are space or tab definitely is project specific.
Closed #3354 as completed.
Fixed in #3355
github-comments@lists.geany.org