mirror of https://git.sr.ht/~rjarry/aerc
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
693 B
Go
36 lines
693 B
Go
package msg
|
|
|
|
import (
|
|
"git.sr.ht/~rjarry/aerc/commands"
|
|
"git.sr.ht/~rjarry/aerc/lib/ui"
|
|
)
|
|
|
|
type ToggleThreadContext struct{}
|
|
|
|
func init() {
|
|
commands.Register(ToggleThreadContext{})
|
|
}
|
|
|
|
func (ToggleThreadContext) Description() string {
|
|
return "Show/hide message thread context."
|
|
}
|
|
|
|
func (ToggleThreadContext) Context() commands.CommandContext {
|
|
return commands.MESSAGE_LIST | commands.MESSAGE_VIEWER
|
|
}
|
|
|
|
func (ToggleThreadContext) Aliases() []string {
|
|
return []string{"toggle-thread-context"}
|
|
}
|
|
|
|
func (ToggleThreadContext) Execute(args []string) error {
|
|
h := newHelper()
|
|
store, err := h.store()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
store.ToggleThreadContext()
|
|
ui.Invalidate()
|
|
return nil
|
|
}
|