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

For #8531
`findBar` is already used in module scope, so change it in this inner scope to something like `bar` to make code easier to read.