Skip to content

Commit

Permalink
[6.2.0] 调整 CommandBase 补全逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
Bkm016 committed Oct 23, 2024
1 parent 524d729 commit c808f9c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ class CommandBase : CommandComponent(-1, false) {
context.index = cur
context.currentComponent = component
// 获取当前输入参数
val args = context.realArgs[cur]
val current = context.realArgs[cur]
// 检索节点
val find = component.findChildren(context, args)
val find = component.findChildren(context, current)
if (find != null) {
context.currentComponent = find
}
Expand All @@ -127,7 +127,7 @@ class CommandBase : CommandComponent(-1, false) {
else -> emptyList()
}
}
suggest.filter { args.isEmpty() }.ifEmpty { null }
suggest.filter { current.isEmpty() || it.contains(current, ignoreCase = true) }.ifEmpty { null }
}
else -> null
}
Expand Down

0 comments on commit c808f9c

Please sign in to comment.