Browse Source

Sort unused palette commands alphabetically

kobewi 2 năm trước cách đây
mục cha
commit
d8663b1a70
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      editor/editor_command_palette.h

+ 5 - 1
editor/editor_command_palette.h

@@ -66,7 +66,11 @@ class EditorCommandPalette : public ConfirmationDialog {
 
 	struct CommandHistoryComparator {
 		_FORCE_INLINE_ bool operator()(const CommandEntry &A, const CommandEntry &B) const {
-			return A.last_used > B.last_used;
+			if (A.last_used == B.last_used) {
+				return A.display_name < B.display_name;
+			} else {
+				return A.last_used > B.last_used;
+			}
 		}
 	};