aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/dirlist.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-04-28 22:09:53 +0200
committerRobin Jarry <robin@jarry.cc>2022-04-29 13:41:38 +0200
commite1ae7b80cc49bf28d93943438ac4e68d22ee7ada (patch)
treea0172d2931a5fe97aef72a13461c5a1adab810ee /widgets/dirlist.go
parent8f976af17bdb049dab21bd4f7d24f352a54c9ba0 (diff)
downloadaerc-e1ae7b80cc49bf28d93943438ac4e68d22ee7ada.tar.gz
dirlist: add format specifier to compact folder name
Add the format specifier %N to the dirlist-format to display compacted folder names. A folder such as INBOX/WORK/PROJECT will be compacted to I/W/PROJECT in the directoy list. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'widgets/dirlist.go')
-rw-r--r--widgets/dirlist.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index 5ddb1362..412ed06c 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -15,6 +15,7 @@ import (
"git.sr.ht/~rjarry/aerc/config"
"git.sr.ht/~rjarry/aerc/lib"
+ "git.sr.ht/~rjarry/aerc/lib/format"
libsort "git.sr.ht/~rjarry/aerc/lib/sort"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
@@ -206,6 +207,9 @@ func (dirlist *DirectoryList) getDirString(name string, width int, recentUnseen
if percent {
rightJustify = true
}
+ case 'N':
+ name = format.CompactPath(name, os.PathSeparator)
+ fallthrough
case 'n':
if percent {
if rightJustify {