Fixed prefix length bug

This commit is contained in:
Simon Cambier
2023-01-19 22:02:19 +01:00
parent 42ba653642
commit 5bc3ac045a
2 changed files with 3 additions and 3 deletions

View File

@@ -280,12 +280,12 @@ export class Omnisearch {
let results: SearchResult[] let results: SearchResult[]
if (settings.simpleSearch) { if (settings.simpleSearch) {
results = await this.search(query, { results = await this.search(query, {
prefixLength: 1, prefixLength: 3,
singleFilePath: options?.singleFilePath, singleFilePath: options?.singleFilePath,
}) })
} else { } else {
results = await this.search(query, { results = await this.search(query, {
prefixLength: 3, prefixLength: 1,
singleFilePath: options?.singleFilePath, singleFilePath: options?.singleFilePath,
}) })
} }

View File

@@ -210,7 +210,7 @@ export class SettingsTab extends PluginSettingTab {
new Setting(containerEl) new Setting(containerEl)
.setName('Simpler search') .setName('Simpler search')
.setDesc( .setDesc(
`Enable this if Obsidian often freezes while making searches. This will return more strict results.` `Enable this if Obsidian often freezes while making searches. This may return fewer results.`
) )
.addToggle(toggle => .addToggle(toggle =>
toggle.setValue(settings.simpleSearch).onChange(async v => { toggle.setValue(settings.simpleSearch).onChange(async v => {