Using 2 modals to display the different kinds of results

This commit is contained in:
Simon Cambier
2022-04-18 10:28:13 +02:00
parent cfa24b9617
commit 6cb113b87e
8 changed files with 218 additions and 81 deletions

View File

@@ -12,13 +12,10 @@ export default class OmnisearchPlugin extends Plugin {
async onload(): Promise<void> {
plugin.set(this)
await initGlobalSearchIndex()
// Commands to display Omnisearch modal
// Commands to display Omnisearch modals
this.addCommand({
id: 'show-modal',
name: 'Vault search',
// hotkeys: [{ modifiers: ['Mod'], key: 'o' }],
callback: () => {
new OmnisearchModal(this).open()
},
@@ -27,7 +24,6 @@ export default class OmnisearchPlugin extends Plugin {
this.addCommand({
id: 'show-modal-infile',
name: 'In-file search',
// hotkeys: [{ modifiers: ['Mod'], key: 'o' }],
checkCallback: (checking: boolean) => {
const view = this.app.workspace.getActiveViewOfType(MarkdownView)
if (view) {
@@ -65,5 +61,7 @@ export default class OmnisearchPlugin extends Plugin {
}
}),
)
initGlobalSearchIndex()
}
}