Fixes #37 Rewrite the indentation logic to be more robust

* reuses the whitespace from the previous line
* adds additional whitespace to indent (just like before)
* moves the caret to the end of the whitespace (like Java)