clear the search register after the :global and both :substitute invocations
don't add parentheses if they were already present
preserve position and jumplist

mark the original cursor position and jump there in the end. use
:keepjumps where necessary. pop the first jumplist entry.