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

fix(tui): sort custom commands lower

adamdotdevin пре 7 месеци
родитељ
комит
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 {
 		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))
 	})
 	})