Keep query and replace text when switching between Replace and Replace I...

...n Files
For #8531