Skip to content

Commit

Permalink
fix: completion pum not match the right item
Browse files Browse the repository at this point in the history
  • Loading branch information
hexh250786313 committed Jun 3, 2024
1 parent 91d3c24 commit 7adbccb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/completion/pum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 7adbccb

Please sign in to comment.