Fix bisect script run and level validators

This commit is contained in:
Joe Tretter
2026-06-26 19:00:51 -05:00
parent caaf26a541
commit d703f539d3
5 changed files with 79 additions and 4 deletions

View File

@@ -369,7 +369,12 @@ fun GitHugApp() {
if (token.isBlank() && !isCdCompletion) return
val candidates = runtime.completionCandidates(currentLevel, repo, directoriesOnly = isCdCompletion)
val matches = candidates.sorted().filter { it.startsWith(token) }
val matches = contextualCompletionCandidates(
candidates = candidates,
commandBeforeToken = beforeCursor.substring(0, tokenStart),
token = token,
directoriesOnly = isCdCompletion,
)
if (matches.isEmpty()) return
val replacement = if (matches.size == 1) matches.first() else commonPrefix(matches)