fixes #57, wrong caret behavior when inserting spaces on indent