feat: support pass view state

This commit is contained in:
quorafind 2025-02-27 16:24:55 +08:00
parent 4bb81fa23e
commit e56db18fae

View file

@ -903,7 +903,7 @@ export default class FloatSearchPlugin extends Plugin {
}
);
}
}
},
});
} else {
this.addCommand({
@ -1023,7 +1023,10 @@ export default class FloatSearchPlugin extends Plugin {
);
return;
}
await initSearchViewWithLeaf(this.app, type);
await initSearchViewWithLeaf(this.app, type, {
...this.state,
triggerBySelf: true,
});
break;
case "tab":
case "split":
@ -1043,7 +1046,10 @@ export default class FloatSearchPlugin extends Plugin {
});
return;
}
await initSearchViewWithLeaf(this.app, type);
await initSearchViewWithLeaf(this.app, type, {
...this.state,
triggerBySelf: true,
});
break;
}
},
@ -1416,6 +1422,7 @@ class FloatSearchModal extends Modal {
this.searchLeaf.setPinned(true);
await this.searchLeaf.setViewState({
type: "search",
state: this.state,
});
setTimeout(async () => {