update selection insertText, collapse cursor after insert