From 3f6e242b5dabc371098dd62899ed8712661e957b Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Mon, 1 May 2023 16:05:10 +0200 Subject: [PATCH 01/14] Removed old comment --- src/search/omnisearch.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/search/omnisearch.ts b/src/search/omnisearch.ts index 9db3177..c1ecf06 100644 --- a/src/search/omnisearch.ts +++ b/src/search/omnisearch.ts @@ -226,8 +226,6 @@ export class Omnisearch { ) } - // If the query does not return any result, - // retry but with a shorter prefix limit if (!results.length) { return [] } From 4a935b3edab9570c1129c433bc9e93b273c0d8a1 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Mon, 1 May 2023 16:05:39 +0200 Subject: [PATCH 02/14] #232 - Tentative fix --- src/components/InputSearch.svelte | 15 +++++++++------ src/components/ModalVault.svelte | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/InputSearch.svelte b/src/components/InputSearch.svelte index e649c54..a7ede1f 100644 --- a/src/components/InputSearch.svelte +++ b/src/components/InputSearch.svelte @@ -5,24 +5,27 @@ import { cacheManager } from '../cache-manager' export let initialValue = '' - let initialSet = false export let placeholder = '' + let initialSet = false let value = '' let elInput: HTMLInputElement const dispatch = createEventDispatcher() - export function setInputValue(v:string): void { + export function setInputValue(v: string): void { + console.log('setinput') value = v } - $: { - if (initialValue && !initialSet && !value) { + function watchInitialValue(v: string): void { + if (v && !initialSet && !value) { initialSet = true - value = initialValue + value = v selectInput() } } + $: watchInitialValue(initialValue) + function selectInput(_?: HTMLElement): void { tick() .then(() => { @@ -46,7 +49,7 @@
Date: Mon, 1 May 2023 16:08:12 +0200 Subject: [PATCH 03/14] Fixed css issue --- assets/styles.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/styles.css b/assets/styles.css index eccf2d5..2e8501e 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -18,6 +18,7 @@ } .omnisearch-result__title { + white-space: pre-wrap; align-items: center; display: flex; gap: 5px; From a7612178f172fd372e0e19a3f09bbf81289d1c10 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Mon, 1 May 2023 16:09:35 +0200 Subject: [PATCH 04/14] 1.14.1-beta.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b59c13f..00fa83e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scambier.obsidian-search", - "version": "1.14.0", + "version": "1.14.1-beta.1", "description": "A search engine for Obsidian", "main": "dist/main.js", "scripts": { From 362df5360b5141e2de1fc329517b4feb4e9f69cb Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Tue, 9 May 2023 19:11:55 +0200 Subject: [PATCH 05/14] #229 - "disable on this device" (#238) --- src/globals.ts | 1 + src/main.ts | 10 ++++++- src/settings.ts | 50 +++++++++++++++++++++++++++------ src/typings/types-obsidian.d.ts | 4 +-- 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/src/globals.ts b/src/globals.ts index 49ce0be..db14f9b 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -16,6 +16,7 @@ export const excerptAfter = 300 export const highlightClass = `suggestion-highlight omnisearch-highlight ${ settings.highlight ? 'omnisearch-default-highlight' : '' }` +export const K_DISABLE_OMNISEARCH = 'omnisearch-disabled' export const eventBus = new EventBus() diff --git a/src/main.ts b/src/main.ts index 0f1e655..4e9566d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,7 @@ import { OmnisearchVaultModal, } from './components/modals' import { + isPluginDisabled, loadSettings, saveSettings, settings, @@ -29,6 +30,13 @@ export default class OmnisearchPlugin extends Plugin { async onload(): Promise { await loadSettings(this) + this.addSettingTab(new SettingsTab(this)) + + if (isPluginDisabled()) { + console.log('Omnisearch - Plugin disabled') + return + } + await cleanOldCacheFiles() await OmnisearchCache.clearOldDatabases() @@ -38,7 +46,6 @@ export default class OmnisearchPlugin extends Plugin { this.addRibbonButton() } - this.addSettingTab(new SettingsTab(this)) eventBus.disable('vault') eventBus.disable('infile') eventBus.on('global', EventNames.ToggleExcerpts, () => { @@ -252,3 +259,4 @@ function registerAPI(plugin: OmnisearchPlugin): void { // Deprecated ;(app as any).plugins.plugins.omnisearch.api = api } + diff --git a/src/settings.ts b/src/settings.ts index 9f8b536..0d2548f 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -7,7 +7,7 @@ import { } from 'obsidian' import { writable } from 'svelte/store' import { database } from './database' -import { getTextExtractor, isCacheEnabled } from './globals' +import { K_DISABLE_OMNISEARCH, getTextExtractor, isCacheEnabled } from './globals' import type OmnisearchPlugin from './main' interface WeightingSettings { @@ -55,6 +55,8 @@ export interface OmnisearchSettings extends WeightingSettings { */ export const showExcerpt = writable(false) +const needsARestart = `Needs a restart to fully take effect.` + export class SettingsTab extends PluginSettingTab { plugin: OmnisearchPlugin @@ -72,6 +74,11 @@ export class SettingsTab extends PluginSettingTab { const { containerEl } = this containerEl.empty() + if (app.loadLocalStorage(K_DISABLE_OMNISEARCH) == '1') { + const span = containerEl.createEl('span') + span.innerHTML = `⚠️ OMNISEARCH IS DISABLED ⚠️` + } + // Settings main title containerEl.createEl('h2', { text: 'Omnisearch' }) @@ -138,7 +145,7 @@ export class SettingsTab extends PluginSettingTab { Add extensions separated by a space, without the dot. Example: "txt org".
⚠️ Using extensions of non-plaintext files (like .docx or .pptx) WILL cause crashes, because Omnisearch will try to index their content.
- Needs a restart to fully take effect.` + ${needsARestart}` }) new Setting(containerEl) .setName('Additional files to index') @@ -192,7 +199,7 @@ export class SettingsTab extends PluginSettingTab { span.innerHTML = `Normalize diacritics in search terms. Words like "brûlée" or "žluťoučký" will be indexed as "brulee" and "zlutoucky".
⚠️ You probably should NOT disable this.
⚠️ Changing this setting will clear the cache.
- Needs a restart to fully take effect. + ${needsARestart} ` }) new Setting(containerEl) @@ -211,7 +218,7 @@ export class SettingsTab extends PluginSettingTab { camelCaseDesc.createSpan({}, span => { span.innerHTML = `Enable this if you want to be able to search for CamelCaseWords as separate words.
⚠️ Changing this setting will clear the cache.
- Needs a restart to fully take effect. + ${needsARestart} ` }) new Setting(containerEl) @@ -364,7 +371,9 @@ export class SettingsTab extends PluginSettingTab { new Setting(containerEl) .setName('Enable verbose logging') - .setDesc('Adds a LOT of logs for debugging purposes. Don\'t forget to disable it.') + .setDesc( + "Adds a LOT of logs for debugging purposes. Don't forget to disable it." + ) .addToggle(toggle => toggle.setValue(settings.verboseLogging).onChange(async v => { settings.verboseLogging = v @@ -375,14 +384,33 @@ export class SettingsTab extends PluginSettingTab { //#endregion Debugginh //#region Danger Zone - if (isCacheEnabled()) { - new Setting(containerEl).setName('Danger Zone').setHeading() + new Setting(containerEl).setName('Danger Zone').setHeading() + const disableDesc = new DocumentFragment() + disableDesc.createSpan({}, span => { + span.innerHTML = `Disable Omnisearch on this device only.
+ ${needsARestart}` + }) + new Setting(containerEl) + .setName('Disable on this device') + .setDesc(disableDesc) + .addToggle(toggle => + toggle.setValue(isPluginDisabled()).onChange(async v => { + if (v) { + app.saveLocalStorage(K_DISABLE_OMNISEARCH, '1') + } else { + app.saveLocalStorage(K_DISABLE_OMNISEARCH) // No value = unset + } + new Notice('Omnisearch - Disabled. Please restart Obsidian.') + }) + ) + + if (isCacheEnabled()) { const resetCacheDesc = new DocumentFragment() resetCacheDesc.createSpan({}, span => { span.innerHTML = `Erase all Omnisearch cache data. - Use this if Omnisearch results are inconsistent, missing, or appear outdated.
- Needs a restart to fully take effect.` + Use this if Omnisearch results are inconsistent, missing, or appear outdated.
+ ${needsARestart}` }) new Setting(containerEl) .setName('Clear cache data') @@ -446,3 +474,7 @@ export async function loadSettings(plugin: Plugin): Promise { export async function saveSettings(plugin: Plugin): Promise { await plugin.saveData(settings) } + +export function isPluginDisabled(): boolean { + return app.loadLocalStorage(K_DISABLE_OMNISEARCH) == '1' +} \ No newline at end of file diff --git a/src/typings/types-obsidian.d.ts b/src/typings/types-obsidian.d.ts index ce997a3..e12dc9d 100644 --- a/src/typings/types-obsidian.d.ts +++ b/src/typings/types-obsidian.d.ts @@ -17,7 +17,7 @@ declare module 'obsidian' { interface App { appId: string + loadLocalStorage(key: string): string | null + saveLocalStorage(key: string, value?: string): void } } - - From 8b7cd2d3e3ea5d849f97edcc286f0809386f5b5f Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Tue, 9 May 2023 21:50:51 +0200 Subject: [PATCH 06/14] Fixed #236 - missing space with highlighted words (#239) --- src/components/ResultItemVault.svelte | 5 +++-- src/tools/utils.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/ResultItemVault.svelte b/src/components/ResultItemVault.svelte index 7cf310e..3360581 100644 --- a/src/components/ResultItemVault.svelte +++ b/src/components/ResultItemVault.svelte @@ -71,8 +71,9 @@ {@html title.replace(reg, highlighterGroups)} - .{getExtension(note.path)} + + .{getExtension(note.path)} + {#if note.matches.length > 0} diff --git a/src/tools/utils.ts b/src/tools/utils.ts index 8ab8131..8984078 100644 --- a/src/tools/utils.ts +++ b/src/tools/utils.ts @@ -33,7 +33,7 @@ export function highlighterGroups(...args: any[]) { args[2] !== null && args[2] !== undefined ) - return `${args[1]}${args[2]}` + return `${args[1]}${args[2]}` return '<no content>' } From 0d6907abbdcda155db2fc2619adc7cb54dbe162b Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Sat, 13 May 2023 22:04:37 +0200 Subject: [PATCH 07/14] Cancelable search query --- pnpm-lock.yaml | 6 +++--- src/components/InputSearch.svelte | 3 +-- src/components/ModalVault.svelte | 14 +++++++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4558293..640b074 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,7 +58,7 @@ devDependencies: esbuild-plugin-copy: 1.3.0_esbuild@0.14.0 esbuild-svelte: 0.7.1_wvi5wuag3veo5vm52k3h7pgaae jest: 27.5.1 - obsidian: 1.1.1 + obsidian: 1.2.8 prettier: 2.8.1 prettier-plugin-svelte: 2.8.1_sro2v6ld777payjtkjtiuogcxi svelte: 3.54.0 @@ -4119,8 +4119,8 @@ packages: object-keys: 1.1.1 dev: true - /obsidian/1.1.1: - resolution: {integrity: sha512-GcxhsHNkPEkwHEjeyitfYNBcQuYGeAHFs1pEpZIv0CnzSfui8p8bPLm2YKLgcg20B764770B1sYGtxCvk9ptxg==} + /obsidian/1.2.8: + resolution: {integrity: sha512-HrC+feA8o0tXspj4lEAqxb1btwLwHD2oHXSwbbN+CdRHURqbCkuIDLld+nkuyJ1w1c9uvVDRVk8BoeOnWheOrQ==} peerDependencies: '@codemirror/state': ^6.0.0 '@codemirror/view': ^6.0.0 diff --git a/src/components/InputSearch.svelte b/src/components/InputSearch.svelte index a7ede1f..15b4df2 100644 --- a/src/components/InputSearch.svelte +++ b/src/components/InputSearch.svelte @@ -12,7 +12,6 @@ const dispatch = createEventDispatcher() export function setInputValue(v: string): void { - console.log('setinput') value = v } @@ -42,7 +41,7 @@ // the next time we open the modal, the search field will be empty cacheManager.addToSearchHistory('') dispatch('input', value) - }, 250) + }, 300)
diff --git a/src/components/ModalVault.svelte b/src/components/ModalVault.svelte index d509a2f..a1063cb 100644 --- a/src/components/ModalVault.svelte +++ b/src/components/ModalVault.svelte @@ -27,6 +27,7 @@ import * as NotesIndex from '../notes-index' import { cacheManager } from '../cache-manager' import { searchEngine } from 'src/search/omnisearch' + import { cancelable, CancelablePromise } from 'cancelable-promise' export let modal: OmnisearchVaultModal let previousQuery: string | undefined @@ -112,9 +113,20 @@ refInput?.setInputValue(searchQuery) } + let cancelableQuery: CancelablePromise | null = null async function updateResults() { + // If search is already in progress, cancel it and start a new one + if (cancelableQuery) { + cancelableQuery.cancel() + cancelableQuery = null + } query = new Query(searchQuery) - resultNotes = await searchEngine.getSuggestions(query) + cancelableQuery = cancelable( + new Promise(resolve => { + resolve(searchEngine.getSuggestions(query)) + }) + ) + resultNotes = await cancelableQuery selectedIndex = 0 await scrollIntoView() } From a2853fa2fdc9f542ecfcae8d257a580d603220e1 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Sat, 13 May 2023 22:07:17 +0200 Subject: [PATCH 08/14] 1.14.1-beta.2 --- package.json | 2 +- src/components/ModalVault.svelte | 2 +- src/tools/notes.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 00fa83e..d98600d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scambier.obsidian-search", - "version": "1.14.1-beta.1", + "version": "1.14.1-beta.2", "description": "A search engine for Obsidian", "main": "dist/main.js", "scripts": { diff --git a/src/components/ModalVault.svelte b/src/components/ModalVault.svelte index a1063cb..ebee3fa 100644 --- a/src/components/ModalVault.svelte +++ b/src/components/ModalVault.svelte @@ -30,7 +30,7 @@ import { cancelable, CancelablePromise } from 'cancelable-promise' export let modal: OmnisearchVaultModal - let previousQuery: string | undefined + export let previousQuery: string | undefined let selectedIndex = 0 let historySearchIndex = 0 let searchQuery: string | undefined diff --git a/src/tools/notes.ts b/src/tools/notes.ts index 3c02ed4..746cd16 100644 --- a/src/tools/notes.ts +++ b/src/tools/notes.ts @@ -52,7 +52,7 @@ export async function createNote(name: string, newLeaf = false): Promise { let pathPrefix: string switch (app.vault.getConfig('newFileLocation')) { case 'current': - pathPrefix = (app.workspace.getActiveFile()?.parent.path ?? '') + '/' + pathPrefix = (app.workspace.getActiveFile()?.parent?.path ?? '') + '/' break case 'folder': pathPrefix = app.vault.getConfig('newFileFolderPath') + '/' From b5c1d31e85e64bf4b6827dbd5b95cb580b16b085 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Thu, 18 May 2023 15:14:26 +0200 Subject: [PATCH 09/14] Fixed extension filter --- src/search/omnisearch.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/search/omnisearch.ts b/src/search/omnisearch.ts index c1ecf06..3094682 100644 --- a/src/search/omnisearch.ts +++ b/src/search/omnisearch.ts @@ -201,13 +201,16 @@ export class Omnisearch { logDebug('Found', results.length, 'results') - // Filter query results to only keep files that match query.extensions (if any) - if (query.extensions.length) { + // Filter query results to only keep files that match query.query.ext (if any) + if (query.query.ext?.length) { results = results.filter(r => { // ".can" should match ".canvas" const ext = '.' + r.id.split('.').pop() - return query.extensions.some(e => ext.startsWith(e)) + return query.query.ext?.some(e => + ext.startsWith(e.startsWith('.') ? e : '.' + e) + ) }) + console.log(query.query.ext, results.length) } // Filter query results that match the path @@ -219,10 +222,11 @@ export class Omnisearch { ) } if (query.query.exclude.path) { - results = results.filter(r => - !query.query.exclude.path?.some(p => - (r.id as string).toLowerCase().includes(p.toLowerCase()) - ) + results = results.filter( + r => + !query.query.exclude.path?.some(p => + (r.id as string).toLowerCase().includes(p.toLowerCase()) + ) ) } From 027c9e3bc9166289e192379ed83265463dbaa00b Mon Sep 17 00:00:00 2001 From: Ian Fisher Date: Fri, 19 May 2023 03:53:31 -0400 Subject: [PATCH 10/14] Add setting to open/create files in new pane by default (#241) * Manifest 1.14.1-beta.1 * 1.14.1-beta.2 manifest * Add setting to open/create files in new pane by default * Fix typo with key labels * Address review comments --------- Co-authored-by: Simon Cambier --- manifest-beta.json | 2 +- src/components/ModalVault.svelte | 23 +++++++++++++++++++---- src/components/modals.ts | 26 ++++++++++++++++++++++---- src/settings.ts | 14 ++++++++++++++ versions.json | 4 +++- 5 files changed, 59 insertions(+), 10 deletions(-) diff --git a/manifest-beta.json b/manifest-beta.json index 6f67936..7ea5551 100644 --- a/manifest-beta.json +++ b/manifest-beta.json @@ -1,7 +1,7 @@ { "id": "omnisearch", "name": "Omnisearch", - "version": "1.14.0", + "version": "1.14.1-beta.2", "minAppVersion": "1.0.0", "description": "A search engine that just works", "author": "Simon Cambier", diff --git a/src/components/ModalVault.svelte b/src/components/ModalVault.svelte index ebee3fa..b35d964 100644 --- a/src/components/ModalVault.svelte +++ b/src/components/ModalVault.svelte @@ -39,9 +39,24 @@ let indexingStepDesc = '' let searching = true let refInput: InputSearch | undefined + let openInNewPaneKey: string + let openInCurrentPaneKey: string + let createInNewPaneKey: string + let createInCurrentPaneKey: string $: selectedNote = resultNotes[selectedIndex] $: searchQuery = searchQuery ?? previousQuery + $: if (settings.openInNewPane) { + openInNewPaneKey = '↵' + openInCurrentPaneKey = getCtrlKeyLabel() + ' ↵' + createInNewPaneKey = 'shift ↵' + createInCurrentPaneKey = 'ctrl shift ↵' + } else { + openInNewPaneKey = getCtrlKeyLabel() + ' ↵' + openInCurrentPaneKey = '↵' + createInNewPaneKey = 'ctrl shift ↵' + createInCurrentPaneKey = 'shift ↵' + } $: if (searchQuery) { searching = true updateResults().then(() => { @@ -309,7 +324,7 @@ to cycle history
- to open + {openInCurrentPaneKey}to open
tab @@ -317,15 +332,15 @@
- {getCtrlKeyLabel()} ↵ + {openInNewPaneKey} to open in a new pane
- shift ↵ + {createInCurrentPaneKey} to create
- ctrl shift ↵ + {createInNewPaneKey} to create in a new pane
diff --git a/src/components/modals.ts b/src/components/modals.ts index 7b16729..17478ff 100644 --- a/src/components/modals.ts +++ b/src/components/modals.ts @@ -1,7 +1,9 @@ import { App, Modal, TFile } from 'obsidian' +import type { Modifier } from 'obsidian' import ModalVault from './ModalVault.svelte' import ModalInFile from './ModalInFile.svelte' import { eventBus, EventNames, isInputComposition } from '../globals' +import { settings } from '../settings' abstract class OmnisearchModal extends Modal { protected constructor(app: App) { @@ -61,8 +63,24 @@ abstract class OmnisearchModal extends Modal { // #endregion Up/Down navigation + let openInCurrentPaneKey: Modifier[] + let openInNewPaneKey: Modifier[] + let createInCurrentPaneKey: Modifier[] + let createInNewPaneKey: Modifier[] + if (settings.openInNewPane) { + openInCurrentPaneKey = ['Mod'] + openInNewPaneKey = [] + createInCurrentPaneKey = ['Ctrl', 'Shift'] + createInNewPaneKey = ['Shift'] + } else { + openInCurrentPaneKey = [] + openInNewPaneKey = ['Mod'] + createInCurrentPaneKey = ['Shift'] + createInNewPaneKey = ['Ctrl', 'Shift'] + } + // Open in new pane - this.scope.register(['Mod'], 'Enter', e => { + this.scope.register(openInNewPaneKey, 'Enter', e => { e.preventDefault() eventBus.emit('open-in-new-pane') }) @@ -74,17 +92,17 @@ abstract class OmnisearchModal extends Modal { }) // Create a new note - this.scope.register(['Shift'], 'Enter', e => { + this.scope.register(createInCurrentPaneKey, 'Enter', e => { e.preventDefault() eventBus.emit('create-note') }) - this.scope.register(['Ctrl', 'Shift'], 'Enter', e => { + this.scope.register(createInNewPaneKey, 'Enter', e => { e.preventDefault() eventBus.emit('create-note', { newLeaf: true }) }) // Open in current pane - this.scope.register([], 'Enter', e => { + this.scope.register(openInCurrentPaneKey, 'Enter', e => { if (!isInputComposition()) { // Check if the user is still typing e.preventDefault() diff --git a/src/settings.ts b/src/settings.ts index 0d2548f..32d2485 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -47,6 +47,7 @@ export interface OmnisearchSettings extends WeightingSettings { simpleSearch: boolean highlight: boolean splitCamelCase: boolean + openInNewPane: boolean verboseLogging: boolean } @@ -246,6 +247,18 @@ export class SettingsTab extends PluginSettingTab { }) ) + new Setting(containerEl) + .setName('Open in new pane') + .setDesc( + 'Open and create files in a new pane instead of the current pane.' + ) + .addToggle(toggle => + toggle.setValue(settings.openInNewPane).onChange(async v => { + settings.openInNewPane = v + await saveSettings(this.plugin) + }) + ) + //#endregion Behavior //#region User Interface @@ -445,6 +458,7 @@ export const DEFAULT_SETTINGS: OmnisearchSettings = { PDFIndexing: false, imagesIndexing: false, splitCamelCase: false, + openInNewPane: false, ribbonIcon: true, showExcerpt: true, diff --git a/versions.json b/versions.json index 199be64..20bcba2 100644 --- a/versions.json +++ b/versions.json @@ -105,5 +105,7 @@ "1.13.0-beta.2": "1.0.0", "1.13.0": "1.0.0", "1.14.0-beta.1": "1.0.0", - "1.14.0": "1.0.0" + "1.14.0": "1.0.0", + "1.14.1-beta.1": "1.0.0", + "1.14.1-beta.2": "1.0.0" } \ No newline at end of file From d32f250b76763a26e7c0d211364565fd11ef0830 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Fri, 19 May 2023 09:59:00 +0200 Subject: [PATCH 11/14] #175 - fixed label missed it during the review --- src/components/ModalVault.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ModalVault.svelte b/src/components/ModalVault.svelte index b35d964..9bbaf80 100644 --- a/src/components/ModalVault.svelte +++ b/src/components/ModalVault.svelte @@ -50,11 +50,11 @@ openInNewPaneKey = '↵' openInCurrentPaneKey = getCtrlKeyLabel() + ' ↵' createInNewPaneKey = 'shift ↵' - createInCurrentPaneKey = 'ctrl shift ↵' + createInCurrentPaneKey = getCtrlKeyLabel() + ' shift ↵' } else { openInNewPaneKey = getCtrlKeyLabel() + ' ↵' openInCurrentPaneKey = '↵' - createInNewPaneKey = 'ctrl shift ↵' + createInNewPaneKey = getCtrlKeyLabel() + ' shift ↵' createInCurrentPaneKey = 'shift ↵' } $: if (searchQuery) { From 34006f84f858f0223093583f0c76237070f871f7 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Fri, 19 May 2023 10:00:39 +0200 Subject: [PATCH 12/14] 1.14.1-beta.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d98600d..026c0e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scambier.obsidian-search", - "version": "1.14.1-beta.2", + "version": "1.14.1-beta.3", "description": "A search engine for Obsidian", "main": "dist/main.js", "scripts": { From 17c23f8a8194ea7fad489a0a95d203bcee6727e2 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Fri, 19 May 2023 23:20:05 +0200 Subject: [PATCH 13/14] "create in new pane" > using Mod instead of Ctrl --- src/components/modals.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/modals.ts b/src/components/modals.ts index 17478ff..aa86114 100644 --- a/src/components/modals.ts +++ b/src/components/modals.ts @@ -70,13 +70,13 @@ abstract class OmnisearchModal extends Modal { if (settings.openInNewPane) { openInCurrentPaneKey = ['Mod'] openInNewPaneKey = [] - createInCurrentPaneKey = ['Ctrl', 'Shift'] + createInCurrentPaneKey = ['Mod', 'Shift'] createInNewPaneKey = ['Shift'] } else { openInCurrentPaneKey = [] openInNewPaneKey = ['Mod'] createInCurrentPaneKey = ['Shift'] - createInNewPaneKey = ['Ctrl', 'Shift'] + createInNewPaneKey = ['Mod', 'Shift'] } // Open in new pane From fe7baf8bd2e788c29efa5b1e31e4be2d57c00686 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Sat, 27 May 2023 12:45:33 +0200 Subject: [PATCH 14/14] Fixed typo --- src/tools/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/utils.ts b/src/tools/utils.ts index 8984078..6977db4 100644 --- a/src/tools/utils.ts +++ b/src/tools/utils.ts @@ -33,7 +33,7 @@ export function highlighterGroups(...args: any[]) { args[2] !== null && args[2] !== undefined ) - return `${args[1]}${args[2]}` + return `${args[1]}${args[2]}` return '<no content>' }