From 080805f7143aa8b31a1fafca1ce780a08f838518 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Sat, 21 Jun 2025 13:38:42 +0200 Subject: [PATCH] always highlight tokens --- src/settings/index.ts | 1 - src/settings/settings-ui.ts | 13 ------------- src/settings/utils.ts | 1 - src/tools/text-processing.ts | 4 +--- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/settings/index.ts b/src/settings/index.ts index e8e1934..602b0f6 100644 --- a/src/settings/index.ts +++ b/src/settings/index.ts @@ -105,7 +105,6 @@ export function getDefaultSettings(app: App): LocatorSettings { maxEmbeds: 5, renderLineReturnInExcerpts: true, showCreateButton: false, - highlight: true, showPreviousQueryResults: true, simpleSearch: false, tokenizeUrls: false, diff --git a/src/settings/settings-ui.ts b/src/settings/settings-ui.ts index 129ab38..2ed61d1 100644 --- a/src/settings/settings-ui.ts +++ b/src/settings/settings-ui.ts @@ -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) - }) - ) } diff --git a/src/settings/utils.ts b/src/settings/utils.ts index e36d79d..de8093c 100644 --- a/src/settings/utils.ts +++ b/src/settings/utils.ts @@ -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 diff --git a/src/tools/text-processing.ts b/src/tools/text-processing.ts index 9b2e4bd..efb0b27 100644 --- a/src/tools/text-processing.ts +++ b/src/tools/text-processing.ts @@ -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