#70 - Correctly toggling and saving settings.showContext

This commit is contained in:
Simon Cambier
2022-09-20 12:53:37 +02:00
parent 31aab49c54
commit 35110f488d
4 changed files with 35 additions and 27 deletions

View File

@@ -43,6 +43,13 @@ export default class OmnisearchPlugin extends Plugin {
this.addSettingTab(new SettingsTab(this))
eventBus.disable('vault')
eventBus.disable('infile')
eventBus.on('global', 'toggle-context', () => {
settings.update(s => {
s.showContext = !s.showContext
return s
})
this.saveData(get(settings))
})
// Commands to display Omnisearch modals
this.addCommand({