[Geany-Devel] Some Auto-Indentation Ideas

Thomas Martitz thomas.martitz at xxxxx
Thu Mar 14 06:50:02 UTC 2013


Am 14.03.2013 05:42, schrieb Braden Walters:
> I had some ideas for some keybindings or settings that could help with 
> some indentation issues. I'm willing to implement them myself, but I 
> wanted to see what the other developers think first. First, the reason 
> why I want to even write these.
>
> I work on multiple projects, some of which have multiple developers 
> and some where whitespace has been left all around some files. I 
> generally use manual indentation (no auto-indent at all), and I can't 
> help but think there's something better I could do. I could use the 
> current character indent, but then I'll have trailing whitespace 
> everywhere, or I'll have to backspace that out manually (sort of 
> defeats the purpose). I could turn on "Strip trailing whitespace", but 
> that's going to modify a lot of lines I never really changed.
>
> Here are some solutions I've thought up:
> - Keybindings for everything approach: Improve the "smart indent" key 
> binding to just use the global (or project if available) settings for 
> auto-indentation upon striking the key combination. Then, create a key 
> binding that removes all contents from a line, but does not delete the 
> line itself.
> - Strip on return approach: Create a global/project settings option to 
> strip whitespace from the current line upon striking return.

2) already exists in Geany. And when it does so going to the line above 
or below restores the cursors original column position (so you shouldn't 
"return back to a column position of zero").

Check Preferences->Editor->Newline strips trailing spaces. It does not 
seem to be on by default.

Best regards.


More information about the Devel mailing list