Просмотр исходного кода

fix(tui): sort custom commands lower

adamdotdevin 6 месяцев назад
Родитель
Сommit
836c2060c7
1 измененных файлов с 4 добавлено и 4 удалено
  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 {
 			return -1
 		}
-		if a.Custom {
-			return -1
-		}
-		if b.Custom {
+		if a.Custom && !b.Custom {
 			return 1
 		}
+		if !a.Custom && b.Custom {
+			return -1
+		}
 
 		return strings.Compare(string(a.Name), string(b.Name))
 	})