Преглед изворни кода

fix(tui): sort custom commands lower

adamdotdevin пре 1 година
родитељ
комит
6357136ca5
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      packages/tui/internal/commands/command.go

+ 6 - 0
packages/tui/internal/commands/command.go

@@ -92,6 +92,12 @@ func (r CommandRegistry) Sorted() []Command {
 		if b.Name == AppExitCommand {
 			return -1
 		}
+		if a.Custom {
+			return -1
+		}
+		if b.Custom {
+			return 1
+		}
 
 		return strings.Compare(string(a.Name), string(b.Name))
 	})