Improve user experience when using '@' sequence trigger for mentions
In the case when the user intends to write an '@' they have to close
the dialog, then know to press undo, as the '@' is removed instantly.
A better behaviour is to have the '@' highlighted and replaced only
if the inspector is successfully used. If the inspector is dismissed
(with 'esc' or clicking away) the cursor position is restored.