Skip to content

Commit 9d72f86

Browse files
committed
fix tab_complete crash in post-flatenning
1 parent d03867e commit 9d72f86

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib/modules/tabComplete.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import { snakeCase } from 'change-case'
22

33
export const player = function (player: Player, serv: Server, options: Options) {
4-
const sendTabComplete = (matches, existingContent) => {
4+
const sendTabComplete = (allMatches, existingContent) => {
5+
const matches = allMatches.filter((match) => match.startsWith(existingContent))
56
player._client.write('tab_complete', {
6-
matches: matches.filter((match) => match.startsWith(existingContent))
7+
matches: !serv.supportFeature("tabCompleteHasAToolTip") ? matches : matches.map((match) => {
8+
return {
9+
match,
10+
tooltip: ""
11+
}
12+
})
713
})
814
}
915

0 commit comments

Comments
 (0)