diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-03-21 22:18:51 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-03-23 20:55:30 +0100 |
commit | feecc09b73e2c904be42f271e0c10574b98a95ea (patch) | |
tree | 3bc763d021ad55f42debfa326ed2340f0ae06b2b /lib/statusline/folderstate.go | |
parent | e56648029f2231a58ed4afbbe804b845e02fde62 (diff) | |
download | aerc-feecc09b73e2c904be42f271e0c10574b98a95ea.tar.gz |
statusline: make statusline folder-specific
Make statusline folder-specific. Update filter, search and threading
status when changing folders.
Commit 2512c04 ("statusline: implement per-account status") introduced
an account-specific statusline. This makes it account- and
folder-specific.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'lib/statusline/folderstate.go')
-rw-r--r-- | lib/statusline/folderstate.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/statusline/folderstate.go b/lib/statusline/folderstate.go new file mode 100644 index 00000000..50a8c82b --- /dev/null +++ b/lib/statusline/folderstate.go @@ -0,0 +1,28 @@ +package statusline + +type folderState struct { + Search string + Filter string + FilterActivity string + + Threading string +} + +func (fs *folderState) State() []string { + var line []string + + if fs.FilterActivity != "" { + line = append(line, fs.FilterActivity) + } else { + if fs.Filter != "" { + line = append(line, fs.Filter) + } + } + if fs.Search != "" { + line = append(line, fs.Search) + } + if fs.Threading != "" { + line = append(line, fs.Threading) + } + return line +} |