diff --git a/commands/core/spec.go b/commands/core/spec.go index 1082cd4..998bc59 100644 --- a/commands/core/spec.go +++ b/commands/core/spec.go @@ -275,8 +275,21 @@ func Lookup(input string) []Suggestion { func topLevelSuggestions(query string) []Suggestion { results, seen := []Suggestion{}, make(map[string]bool) - // 1. Manual specs (High Priority) + // 1. shell aliases (User's choice precedence) + for name, target := range shellAliases { + if !seen[name] && (query == "" || hasPrefix(name, query)) { + results = append(results, Suggestion{ + Cmd: target, Desc: "alias: " + name, Icon: "root", + }) + seen[name] = true + } + } + + // 2. Manual specs (High Priority) for name, spec := range registry { + if seen[name] { + continue + } match := false if query == "" || hasPrefix(name, query) { match = true @@ -294,16 +307,6 @@ func topLevelSuggestions(query string) []Suggestion { } } - // 2. shell aliases (User's choice precedence) - for name, target := range shellAliases { - if !seen[name] && (query == "" || hasPrefix(name, query)) { - results = append(results, Suggestion{ - Cmd: target, Desc: "alias: " + name, Icon: "root", - }) - seen[name] = true - } - } - // 3. system commands from $PATH for name := range pathCmds { if !seen[name] && (query == "" || hasPrefix(name, query)) {