diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-06-19 16:41:15 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-06-22 11:30:23 +0200 |
commit | e78540990496cb3f4ff611c680b005022d9d2fad (patch) | |
tree | 98e1c0bce1b5bbb80be5beeb98f5bcb6ee70ee44 /config | |
parent | 7aa71d334b2755cc5e92fcf83398ce65ede45b40 (diff) | |
download | aerc-e78540990496cb3f4ff611c680b005022d9d2fad.tar.gz |
binds: add folder context for message list binds
Add option to specify folder-specific binds for message lists. The binds
are layered: any existing binds in [messages] are overwritten by a more
specific bind in say, [messages:folder=Drafts]. The order is currently:
[messages] < [messages:account=<account>] < [messages:folder=<folder>]
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config')
-rw-r--r-- | config/config.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go index dae32b7c..64106329 100644 --- a/config/config.go +++ b/config/config.go @@ -72,6 +72,7 @@ const ( UI_CONTEXT_ACCOUNT UI_CONTEXT_SUBJECT BIND_CONTEXT_ACCOUNT + BIND_CONTEXT_FOLDER ) type UIConfigContext struct { @@ -910,6 +911,10 @@ func (config *AercConfig) LoadBinds(binds *ini.File, baseName string, baseGroup continue } contextualBind.ContextType = BIND_CONTEXT_ACCOUNT + case "folder": + // No validation needed. If the folder doesn't exist, the binds + // never get used + contextualBind.ContextType = BIND_CONTEXT_FOLDER default: return fmt.Errorf("Unknown Context Bind Section: %s", sectionName) } |