From dabaae1534f206dd8513429b882481e6221a6afd Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 11 Jun 2026 23:01:31 +0000 Subject: [PATCH] Make buffer creation time sort oldest first like it used to, but change windows to match sessions and panes as newest first. --- sort.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sort.c b/sort.c index fda6a90b..212da22e 100644 --- a/sort.c +++ b/sort.c @@ -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;