INNER CODE UNIT · Go
lastToken
chriswalz/bit · cmd/bit_cmd.go:108
lastToken := split[len(split)-1]
lastCommand := lastToken
if !strings.HasSuffix(text, " ") && len(split) >= 2 {
lastCommand = split[len(split)-2]
}
// use fuzzy search completion when querying branch names
if isBranchCompletionCommand(lastCommand) {
queryFunc = fuzzyQuery
}
suggestions, err := complete.CompleteLine(text, suggestionTree, queryFunc)
if err != nil {
log.Debug().Err(err).Send()
return sugg
}
// for branches dont undo most recent sorts with alphabetical sort