always highlight tokens

This commit is contained in:
Simon Cambier 2025-06-21 13:38:42 +02:00
parent 88923910aa
commit 080805f714
4 changed files with 1 additions and 18 deletions

View File

@ -105,7 +105,6 @@ export function getDefaultSettings(app: App): LocatorSettings {
maxEmbeds: 5,
renderLineReturnInExcerpts: true,
showCreateButton: false,
highlight: true,
showPreviousQueryResults: true,
simpleSearch: false,
tokenizeUrls: false,

View File

@ -82,17 +82,4 @@ export function injectSettingsUserInterface(
await saveSettings(plugin)
})
)
// Highlight results
new Setting(containerEl)
.setName('Highlight matching words in results')
.setDesc(
'Will highlight matching results when enabled. See README for more customization options.'
)
.addToggle(toggle =>
toggle.setValue(settings.highlight).onChange(async v => {
settings.highlight = v
await saveSettings(plugin)
})
)
}

View File

@ -71,7 +71,6 @@ export interface LocatorSettings extends WeightingSettings {
/** If a query returns 0 result, try again with more relax conditions */
simpleSearch: boolean
tokenizeUrls: boolean
highlight: boolean
splitCamelCase: boolean
openInNewPane: boolean
verboseLogging: boolean

View File

@ -15,9 +15,7 @@ export class TextProcessor {
* @returns The html string with the matches highlighted
*/
public highlightText(text: string, matches: SearchMatch[]): string {
const highlightClass = `suggestion-highlight locator-highlight ${
this.plugin.settings.highlight ? 'locator-default-highlight' : ''
}`
const highlightClass = 'suggestion-highlight locator-highlight locator-default-highlight'
if (!matches.length) {
return text