fixed cursor after insert, inlined performReplacementsForRange