Improved search and replace for current word and selection.