mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 23:35:50 +01:00
chore(code/find): jump to first result
This commit is contained in:
@@ -176,9 +176,13 @@ export default class CodeMirror extends EditorView {
|
||||
this.dispatch({
|
||||
effects: this.searchHighlightCompartment.reconfigure(plugin)
|
||||
});
|
||||
|
||||
// Wait for the plugin to activate in the next render cycle
|
||||
await new Promise(requestAnimationFrame);
|
||||
const instance = this.plugin(plugin); // TS workaround
|
||||
const instance = this.plugin(plugin);
|
||||
if (instance) {
|
||||
instance.scrollToMatch(0);
|
||||
}
|
||||
|
||||
return {
|
||||
totalFound: instance?.totalFound ?? 0
|
||||
|
||||
Reference in New Issue
Block a user