Autoindent for buffers, currently fixed at 2 spaces.
Enabled by setting autoindent to true in preferences.

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

Also had to use a hack-ish solution wrapping the InputStream because JLine
does not provide an API to do autoindent.
Whole-buffer context aware completion using lexer
Completes many but no all expressions where statement before dot
across multiple lines can be evaluated without side-effects
(literals, classes, fields and collections thereof, without parentheses).
Use Jar Classloading to complete import statements.

Examples:
groovy:000> import
groovy:000> import j
groovy:000> import java.
groovy:000> import java.net.
groovy:000> import static java.net.

Also complete Classnames for preimported and imported classes

Example:
groovy:000> Sys<tab>

Before: no completion
Afer: completes to System  (from java.lang.System)

Also:
groovy:000> import java.awt.*
groovy:000> Sha<tab>

now completes to "Shape"

As well imported statics:
groovy:000> import static java.lang.Math.*
===> [import static java.lang.Math.*]
groovy:000> ma<tab>

now completes to "max("
Preference to disable import-class-completion