When CodeMirror highlights selection matches it ignores surrounding whitespace in the selection.
Given the text
if you select the entire last line, any occurrence of “bar” in the previous lines will be highlighted despite having a different prefix and suffix:
vscode for comparison considers the whitespace:
Is the CodeMirror behavior by design? If yes, is there an option to only highlight exact matches?