diff options
author | Robin Jarry <robin@jarry.cc> | 2022-12-11 23:57:30 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-12-14 11:22:53 +0100 |
commit | 9d0297e9d913a92b2d7ae02692e83f0f4093a766 (patch) | |
tree | b34425a8a295b3cc52c4cf20904f85019b6352ab /widgets/msgviewer.go | |
parent | 2937830491b5adedf79c8c218afb2c80b17c019a (diff) | |
download | aerc-9d0297e9d913a92b2d7ae02692e83f0f4093a766.tar.gz |
config: rework contextual sections implementation
The current contextual binds and ui config API is awkward and cumbersome
to use. Rework it to make it more elegant.
Store the contextual sections as private fields of the UIConfig and
KeyBindings structures. Add cache to avoid recomputation of the composed
UIConfig and KeyBindings objects every time a contextual item is
requested. Replace the cache from DirectoryList with that.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r-- | widgets/msgviewer.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 6c929578..875ff873 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -738,12 +738,7 @@ var noFilterConfiguredCommands = [][]string{ } func newNoFilterConfigured(pv *PartViewer) *ui.Grid { - bindings := pv.conf.MergeContextualBinds( - pv.conf.Bindings.MessageView, - config.BIND_CONTEXT_ACCOUNT, - pv.acctConfig.Name, - "view", - ) + bindings := pv.conf.Bindings.MessageView.ForAccount(pv.acctConfig.Name) var actions []string |