#115 - Added a setting to re-execute the previous query when opening Omnisearch
This commit is contained in:
@@ -42,7 +42,9 @@
|
|||||||
eventBus.on('vault', 'prev-search-history', prevSearchHistory)
|
eventBus.on('vault', 'prev-search-history', prevSearchHistory)
|
||||||
eventBus.on('vault', 'next-search-history', nextSearchHistory)
|
eventBus.on('vault', 'next-search-history', nextSearchHistory)
|
||||||
await NotesIndex.refreshIndex()
|
await NotesIndex.refreshIndex()
|
||||||
previousQuery = (await cacheManager.getSearchHistory())[0]
|
if (settings.showPreviousQueryResults) {
|
||||||
|
previousQuery = (await cacheManager.getSearchHistory())[0]
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ export interface OmnisearchSettings extends WeightingSettings {
|
|||||||
showExcerpt: boolean
|
showExcerpt: boolean
|
||||||
/** Enable a "create note" button in the Vault Search modal */
|
/** Enable a "create note" button in the Vault Search modal */
|
||||||
showCreateButton: boolean
|
showCreateButton: boolean
|
||||||
|
/** Re-execute the last query when opening Omnisearch */
|
||||||
|
showPreviousQueryResults: boolean
|
||||||
/** Vim mode shortcuts */
|
/** Vim mode shortcuts */
|
||||||
CtrlJK: boolean
|
CtrlJK: boolean
|
||||||
/** Vim mode shortcuts */
|
/** Vim mode shortcuts */
|
||||||
@@ -214,7 +216,7 @@ export class SettingsTab extends PluginSettingTab {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
// Show Context
|
// Show context excerpt
|
||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
.setName('Show excerpt')
|
.setName('Show excerpt')
|
||||||
.setDesc(
|
.setDesc(
|
||||||
@@ -226,6 +228,19 @@ export class SettingsTab extends PluginSettingTab {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Show context excerpt
|
||||||
|
new Setting(containerEl)
|
||||||
|
.setName('Show previous query results')
|
||||||
|
.setDesc(
|
||||||
|
'Re-executes the previous query when opening Omnisearch'
|
||||||
|
)
|
||||||
|
.addToggle(toggle =>
|
||||||
|
toggle.setValue(settings.showPreviousQueryResults).onChange(async v => {
|
||||||
|
settings.showPreviousQueryResults = v
|
||||||
|
await saveSettings(this.plugin)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
// Show "Create note" button
|
// Show "Create note" button
|
||||||
const createBtnDesc = new DocumentFragment()
|
const createBtnDesc = new DocumentFragment()
|
||||||
createBtnDesc.createSpan({}, span => {
|
createBtnDesc.createSpan({}, span => {
|
||||||
@@ -352,6 +367,7 @@ export const DEFAULT_SETTINGS: OmnisearchSettings = {
|
|||||||
ribbonIcon: true,
|
ribbonIcon: true,
|
||||||
showExcerpt: true,
|
showExcerpt: true,
|
||||||
showCreateButton: false,
|
showCreateButton: false,
|
||||||
|
showPreviousQueryResults: true,
|
||||||
|
|
||||||
weightBasename: 2,
|
weightBasename: 2,
|
||||||
weightH1: 1.5,
|
weightH1: 1.5,
|
||||||
|
|||||||
Reference in New Issue
Block a user