Merge pull request #11 from Quorafind/feat/support-open-search-view

feat: support open search view in leaf
This commit is contained in:
Boninall 2023-03-30 09:14:59 +08:00 committed by GitHub
commit f277a56114
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -273,6 +273,18 @@ export default class FloatSearchPlugin extends Plugin {
}
}
});
this.addCommand({
id: 'open-search-view',
name: 'Open Search View',
callback: async () => {
const leaf = app.workspace.getLeaf();
leaf.setPinned(true);
await leaf.setViewState({
type: "search",
});
}
});
}
registerEditorMenuHandler() {