Keep query and replace text when switching between Replace and Replace In Files

For #8531
Keep `currentEditor` declared here, even though it's not set until later because JS hoists it, anyway.