Fix #2004 - Indent breaks when hitting enter before spaces

Fix #2004 - Indent breaks when hitting enter before spaces

The underlying problem for this issue was not the indent itself, but the caret position afterwards.

This solution handles all possible situations:
- extra spaces after caret > indent (inside IF)
- extra spaces after caret <= indent (inside ELSE)