[Geany-Devel] Some Auto-Indentation Ideas
lists.ban at xxxxx
Thu Mar 14 14:09:54 UTC 2013
Le 14/03/2013 14:58, Roger Booth a écrit :
> On 03/14/2013 06:50 AM, Colomban Wendling wrote:
>> Le 14/03/2013 14:41, Roger Booth a écrit :
>>> On 03/13/2013 09:42 PM, Braden Walters wrote:
>>>> 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.
>>> I've worked as a developer in teams of programmers. I've never seen
>>> examples of "where whitespace has been left all around some files".
>>> Occasionally I see spaces at the end of lines. That doesn't bother me
>>> My main whitespace complaint with Geany is the indentation whitespace
>>> auto-generated when I leave blank lines. So if I am at one tab
>>> indentation and I type return, return, the line above the caret contains
>>> one tab only.
>> As Thomas pointed out, there is an option to automatically remove
>> trailing whitespace upon return, which IIUC would do what you want.
> The part of my reply that you removed explained why the
> option to automatically remove
> trailing whitespace upon return
> doesn't do what I want.
Not really, what I understand from the rest is that you don't like
removing all trailing whitespaces from the whole document (like the
"Document->Strip trailing whitespace" or option "Strip trailing
whitespace on save" does). The option Thomas mentioned only removes
whitespaces from the line you hit return on, so it would only modify the
trailing spaces around the code you actually touched.
More information about the Devel