Skip to content

Commit

Permalink
binds: allow per folder sections for the message viewer
Browse files Browse the repository at this point in the history
Allow creating [view:folder=FooBar] in binds.conf.

Changelog-added: Per folder key bindings can now be defined for the
 message viewer.
Requested-by: Matěj Cepl <[email protected]>
Signed-off-by: Robin Jarry <[email protected]>
Tested-by: Matěj Cepl <[email protected]>
  • Loading branch information
rjarry committed Jun 23, 2024
1 parent 74cea6b commit a37ae23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/aerc.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,16 @@ func (aerc *Aerc) getBindings() *config.KeyBindings {
}
return binds.ForFolder(view.SelectedDirectory())
case *MessageViewer:
var binds *config.KeyBindings
switch view.Bindings() {
case "view::passthrough":
return config.Binds.MessageViewPassthrough.ForAccount(
binds = config.Binds.MessageViewPassthrough.ForAccount(
selectedAccountName)
default:
return config.Binds.MessageView.ForAccount(
binds = config.Binds.MessageView.ForAccount(
selectedAccountName)
}
return binds.ForFolder(view.SelectedAccount().SelectedDirectory())
case *Terminal:
return config.Binds.Terminal
default:
Expand Down
1 change: 1 addition & 0 deletions doc/aerc-binds.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ You may also configure account specific key bindings for each context:
Folder and context-specific bindings can be configured for message lists:

*[messages:folder=*_FolderName_*]*++
*[view:folder=*_FolderName_*]*++
*[compose:folder=*_FolderName_*]*++
*[compose::editor:folder=*_FolderName_*]*++
*[compose::review:folder=*_FolderName_*]*
Expand Down

0 comments on commit a37ae23

Please sign in to comment.