diff options
author | Yash Srivastav <yash111998@gmail.com> | 2019-06-07 13:56:14 +0530 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-06-07 09:20:24 -0400 |
commit | b83e7c9fa6a0d187a0f20d98d522cff792053cdd (patch) | |
tree | 4c3765b41d216e26406d21d3b045f340edabbadc /commands | |
parent | 2279ac3ab3d19cd233600907bc8e3e8b4e57b350 (diff) |
implements ability to view headers in message view
Diffstat (limited to 'commands')
-rw-r--r-- | commands/msgview/toggle-headers.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/commands/msgview/toggle-headers.go b/commands/msgview/toggle-headers.go new file mode 100644 index 0000000..fc29042 --- /dev/null +++ b/commands/msgview/toggle-headers.go @@ -0,0 +1,25 @@ +package msgview + +import ( + "errors" + "fmt" + + "git.sr.ht/~sircmpwn/aerc/widgets" +) + +func init() { + register("toggle-headers", ToggleHeaders) +} + +func toggleHeadersUsage(cmd string) error { + return errors.New(fmt.Sprintf("Usage: %s", cmd)) +} + +func ToggleHeaders(aerc *widgets.Aerc, args []string) error { + if len(args) > 1 { + return toggleHeadersUsage(args[0]) + } + mv, _ := aerc.SelectedTab().(*widgets.MessageViewer) + mv.ToggleHeaders() + return nil +} |