Modified TextPasteIndentEngine.

Saw that this is causing some trouble so I tried something different. I
think it's pretty stable, but don't merge this if the current engine is
working as it should.