refactor(code/find): remove inner class

This commit is contained in:
Elian Doran
2025-05-12 20:59:46 +03:00
parent e5417827f4
commit 8a35e390f2
2 changed files with 75 additions and 65 deletions

View File

@@ -172,7 +172,7 @@ export default class CodeMirror extends EditorView {
}
async performFind(searchTerm: string, matchCase: boolean, wholeWord: boolean) {
const plugin = createSearchHighlighter(this, searchTerm, matchCase, wholeWord);
const plugin = createSearchHighlighter();
this.dispatch({
effects: this.searchHighlightCompartment.reconfigure(plugin)
});
@@ -180,6 +180,7 @@ export default class CodeMirror extends EditorView {
// Wait for the plugin to activate in the next render cycle
await new Promise(requestAnimationFrame);
const instance = this.plugin(plugin);
instance?.searchFor(searchTerm, matchCase, wholeWord);
if (instance) {
instance.scrollToMatchNearestSelection();
}