INNER CODE UNIT · Go

lastCommand

chriswalz/bit · cmd/bit_cmd.go:111

		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
	if !isBranchCompletionCommand(lastCommand) {
		sort.Slice(suggestions, func(i, j int) bool {
			return suggestions[i].Name < suggestions[j].Name

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…