From b83e7c9fa6a0d187a0f20d98d522cff792053cdd Mon Sep 17 00:00:00 2001 From: Yash Srivastav Date: Fri, 7 Jun 2019 13:56:14 +0530 Subject: implements ability to view headers in message view --- commands/msgview/toggle-headers.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 commands/msgview/toggle-headers.go (limited to 'commands/msgview/toggle-headers.go') diff --git a/commands/msgview/toggle-headers.go b/commands/msgview/toggle-headers.go new file mode 100644 index 00000000..fc29042d --- /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 +} -- cgit