mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
refactor(code/find): integrate search into find plugin
This commit is contained in:
parent
8a35e390f2
commit
ba2dae4c61
@ -34,6 +34,7 @@ export class SearchHighlighter {
|
|||||||
decoration: searchMatchDecoration,
|
decoration: searchMatchDecoration,
|
||||||
});
|
});
|
||||||
this.updateSearchData(this.view);
|
this.updateSearchData(this.view);
|
||||||
|
this.scrollToMatchNearestSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSearchData(view: EditorView) {
|
updateSearchData(view: EditorView) {
|
||||||
|
@ -181,9 +181,6 @@ export default class CodeMirror extends EditorView {
|
|||||||
await new Promise(requestAnimationFrame);
|
await new Promise(requestAnimationFrame);
|
||||||
const instance = this.plugin(plugin);
|
const instance = this.plugin(plugin);
|
||||||
instance?.searchFor(searchTerm, matchCase, wholeWord);
|
instance?.searchFor(searchTerm, matchCase, wholeWord);
|
||||||
if (instance) {
|
|
||||||
instance.scrollToMatchNearestSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
totalFound: instance?.totalFound ?? 0,
|
totalFound: instance?.totalFound ?? 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user