Procházet zdrojové kódy

fix(tui): sort custom commands lower

adamdotdevin před 6 měsíci
rodič
revize
836c2060c7
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      packages/tui/internal/commands/command.go

+ 4 - 4
packages/tui/internal/commands/command.go

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