From 84e0c9c926b16e230dda5dee409da29b7e0b0b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Tue, 30 Jul 2024 11:51:12 -0700 Subject: [PATCH] make date column header in table depend on mode --- internal/interactive/interactive.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/interactive/interactive.go b/internal/interactive/interactive.go index c251358..57ffd0b 100644 --- a/internal/interactive/interactive.go +++ b/internal/interactive/interactive.go @@ -94,10 +94,18 @@ func newModel(fls []files.File, width, height int, readonly, preselected, once b rows := mdl.freshRows(preselected) + var datecolumn string + switch mdl.mode { + case modes.Trashing: + datecolumn = "modified" + default: + datecolumn = "trashed" + } + columns := []table.Column{ {Title: "filename", Width: fwidth}, {Title: "path", Width: owidth}, - {Title: "modified", Width: dwidth}, + {Title: datecolumn, Width: dwidth}, {Title: "size", Width: swidth}, } if !mdl.readonly {