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

For #8531
Since you're only interested in the first non-closed bar, you should use `FindBar._bars.some()` which quits the loop when first one is found (but `filter()` unnecessarily continues through entire Array).