From b4cda4338fdd81bd3a6a904bf29291c2524fee4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Tue, 10 Jan 2023 15:24:14 +0800 Subject: [PATCH] fix(command): trim spaces --- components/command/CommandPanel.vue | 6 +++--- composables/dialog.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/command/CommandPanel.vue b/components/command/CommandPanel.vue index 9dce81a0..03086dbe 100644 --- a/components/command/CommandPanel.vue +++ b/components/command/CommandPanel.vue @@ -60,7 +60,7 @@ const searchResult = $computed(() => { }) const result = $computed(() => commandMode - ? registry.query(scopes.map(s => s.id).join('.'), input.slice(1)) + ? registry.query(scopes.map(s => s.id).join('.'), input.slice(1).trim()) : searchResult, ) @@ -79,13 +79,13 @@ const onCommandActivate = (item: QueryResultItem) => { } else if (item.onComplete) { scopes.push(item.onComplete()) - input = '>' + input = '> ' } } const onCommandComplete = (item: QueryResultItem) => { if (item.onComplete) { scopes.push(item.onComplete()) - input = '>' + input = '> ' } else if (item.onActivate) { item.onActivate() diff --git a/composables/dialog.ts b/composables/dialog.ts index 46f9e08a..ac8f1018 100644 --- a/composables/dialog.ts +++ b/composables/dialog.ts @@ -119,7 +119,7 @@ export function closePreviewHelp() { } export function openCommandPanel(isCommandMode = false) { - commandPanelInput.value = isCommandMode ? '>' : '' + commandPanelInput.value = isCommandMode ? '> ' : '' isCommandPanelOpen.value = true }