added a comment - - edited
While functional and desirable, I am concerned about the manner in which this patch is implemented. Currently all text editing functionality is local to the groovy.ui.text package, in mostly java classes. I feel that overloading it with groovy key listeners may comprimise future maintainability.
I would recommend that the implementation be placed in groovy.ui.text.TextEditor and implemented as Actions mapped via the InputMap and ActionMap, as is currently done for the soft-tab feature and indent/dedent features.
Also, there should be some sort of a kill-switch boolean to turn it off and on via a method. I don't know of anyone who wouldn't like auto-indent, but I am sure we will find someone at some point.
patch v2