codemirror: Consider focus state for filter highlighting on every update
Created by: fkling
Note: Best reviewed with white space changes turned off.
Currently when navigating e.g. from search results to a file, we will update the content of the search query input but not focus it. Because the content changes the logic for recomputing the current filter highlight gets triggered and highlights the last filter in the input, which is not desirable:
This commit updates the logic to take the focus state into account on every update.
Test plan
- Go to https://sourcegraph.test:3443/search and perform a (file) search
- Select any search result
- Observe that on the file page the search query input is not focused and none of the filters is highlighted.
App preview:
Check out the client app preview documentation to learn more.