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

For #8531
I used [`_.find()`](https://lodash.com/docs#find) as `Array.filter` will only return a boolean value...