Make buffer creation time sort oldest first like it used to, but change

windows to match sessions and panes as newest first.
This commit is contained in:
nicm
2026-06-11 23:01:31 +00:00
parent 11b6e7844a
commit 574a4eccb5

11
sort.c
View File

@@ -65,7 +65,12 @@ sort_buffer_cmp(const void *a0, const void *b0)
result = strcmp(pa->name, pb->name);
break;
case SORT_CREATION:
result = pa->order - pb->order;
if (pa->order > pb->order)
result = -1;
else if (pa->order < pb->order)
result = 1;
else
result = 0;
break;
case SORT_SIZE:
result = pa->size - pb->size;
@@ -251,11 +256,11 @@ sort_winlink_cmp(const void *a0, const void *b0)
break;
case SORT_CREATION:
if (timercmp(&wa->creation_time, &wb->creation_time, >)) {
result = -1;
result = 1;
break;
}
if (timercmp(&wa->creation_time, &wb->creation_time, <)) {
result = 1;
result = -1;
break;
}
break;