groovy/groovy-core — pull request #152 by tkruse (2013-03-30 18:14:53+00:00)
Title: groovysh Autoindent for buffers, currently fixed at 2 spaces.

Merge with caution, I am very new to Groovy.

The current buffer is lexed using the default Groovy Lexer,
which keeps track of parentheses in a stack, using the depth of that stack.

Dedents after closing brackets (does not consider multiple closing brackets).

Also had to use a hack-ish solution wrapping the InputStream because JLine
does not provide an API to do autoindent.