aboutsummaryrefslogblamecommitdiffstats
path: root/commands/msgview/toggle-headers.go
blob: c2b4e8f76b45d611bedecb9cbec4c303fc6d29d6 (plain) (tree)
1
2
3
4
5
6
7
8
9


               
                                    
                                         

 

                           
             


                                          



                                                          

                                                        

 
                                         


                                         
                                                   
                                                              


                          
package msgview

import (
	"git.sr.ht/~rjarry/aerc/app"
	"git.sr.ht/~rjarry/aerc/commands"
)

type ToggleHeaders struct{}

func init() {
	commands.Register(ToggleHeaders{})
}

func (ToggleHeaders) Description() string {
	return "Toggle the visibility of message headers."
}

func (ToggleHeaders) Context() commands.CommandContext {
	return commands.MESSAGE_VIEWER
}

func (ToggleHeaders) Aliases() []string {
	return []string{"toggle-headers"}
}

func (ToggleHeaders) Execute(args []string) error {
	mv, _ := app.SelectedTabContent().(*app.MessageViewer)
	mv.ToggleHeaders()
	return nil
}