From ff9c5cd00a28c01e765e4d7bc7d07a31758b2a0a Mon Sep 17 00:00:00 2001 From: ZiuChen Date: Sun, 21 Jan 2024 01:09:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=84=9A=E6=9C=AC=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=81=9A=E7=84=A6=E5=BD=93=E5=89=8D=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/monaco/addActions.ts | 4 ++-- src/views/Runner.vue | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/monaco/addActions.ts b/src/common/monaco/addActions.ts index 044190a..56c7ebf 100644 --- a/src/common/monaco/addActions.ts +++ b/src/common/monaco/addActions.ts @@ -24,9 +24,9 @@ export function addActions( id: 'quickInput', label: 'Quick Input', contextMenuGroupId: 'buildin-action', - run: (editor, { list, callback }) => { + run: (editor, { list, callback, options }) => { editor.trigger('', quickInputCommand!, (quickInput: any) => { - quickInput.pick(list).then((selected?: any) => { + quickInput.pick(list, options).then((selected?: any) => { callback(selected) }) }) diff --git a/src/views/Runner.vue b/src/views/Runner.vue index 623f4bf..a35676b 100644 --- a/src/views/Runner.vue +++ b/src/views/Runner.vue @@ -102,6 +102,9 @@ function handleEditorAction(action: EditorAction) { editorRef.value?.editor?.focus() editorRef.value?.editor?.trigger('', 'quickInput', { list, + options: { + activeItem: list[list.findIndex((item) => item.id === store.id)] + }, callback: (selected?: (typeof list)[0]) => { if (selected) { useCodeStore().loadCode(selected.id)