From 7adbccbe8fa08a1c5031f62f8d2c6296f49e94b8 Mon Sep 17 00:00:00 2001 From: hexh <250786313@qq.com> Date: Mon, 3 Jun 2024 17:21:04 +0800 Subject: [PATCH] fix: completion pum not match the right item --- src/completion/pum.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/completion/pum.ts b/src/completion/pum.ts index cf8afe06b1d..68fc1bf3849 100644 --- a/src/completion/pum.ts +++ b/src/completion/pum.ts @@ -166,7 +166,9 @@ export default class PopupMenu { } if (selectedIndex !== -1 && search.length > 0) { let item = items[selectedIndex] - if (!item.word.startsWith(search)) { + // `word` and `filterText` may be different + // `search` may match `word` or `filterText` + if (!item.word.startsWith(search) && !item.filterText.startsWith(search)) { selectedIndex = -1 } }