Thanks for the info - I will look at it.
I think the problem is that I don't want to insert the indent spaces/tabs until something is actually typed on the line - if Enter is pressed, I just want an empty line (not spaces/tabs + newline). The caret position is "faked" when showing the indent position, while waiting for the next typed character. It's a "mode" which I probably kill when switching away to another window. When switching back, the "real" position will be used (at the beginning, since the line is really empty).
Pelle