This used to work only for the "standard" completion model and got removed when the code was refactored. This change makes this feature available for all the CodeCompletionModels
If a model moves the cursor after inserting the new text, the undo will insert the tail at the new cursor position.