[Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

Matthew Brush mbrush at xxxxx
Wed Dec 7 02:06:13 UTC 2011


On 12/05/2011 10:30 AM, Colomban Wendling wrote:
> Hi,
>
> I know this is a more than one year old discussion, but I was messing
> with a very similar thing a few minutes ago when wanting to add
> autoindent support for SH.
>

Sorry I haven't followed/read the whole thread, but I wanted to add a 
feature request if someone's going to hack on this.

It would be nice if the auto-indent was "undone" when you leave a blank 
line, example (assuming this is all being typed, not loaded from disk):

     struct foobar
     {
         int baz;<--- hit enter here
         <--- here's an audo-indented tab
         char *bong;<-- auto-indented
     };

Would do this (assuming it happens as you type):

     struct foobar
     {
         int baz;<--- hit enter here
     <--- indent removed, since the user hit enter again and kept typing
         char *bong;<-- re-indented
     };

This is the #1 thing I fight against in the auto-indenter, which is why 
I usually turn on "Strip trailing spaces and tabs", but that's too 
brute-force since it applies to the whole file on save instead of just 
the whitespace noise added by the auto-indenter.

Anyway, just a request, feel free to ignore :)

Cheers,
Matthew Brush



More information about the Devel mailing list