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

For #8531
Cool -- even better. With `Array.some()`, you have to create a var in outer scope to save item.