| 1 |
package msgview |
| 2 |
|
| 3 |
import ( |
| 4 |
"git.sr.ht/~rjarry/aerc/app" |
| 5 |
"git.sr.ht/~rjarry/aerc/commands" |
| 6 |
"git.sr.ht/~rjarry/aerc/config" |
| 7 |
) |
| 8 |
|
| 9 |
type ToggleKeyPassthrough struct{} |
| 10 |
|
| 11 |
func init() { |
| 12 |
commands.Register(ToggleKeyPassthrough{}) |
| 13 |
} |
| 14 |
|
| 15 |
func (ToggleKeyPassthrough) Description() string { |
| 16 |
return "Enter or exit the passthrough key bindings context." |
| 17 |
} |
| 18 |
|
| 19 |
func (ToggleKeyPassthrough) Context() commands.CommandContext { |
| 20 |
return commands.MESSAGE_VIEWER |
| 21 |
} |
| 22 |
|
| 23 |
func (ToggleKeyPassthrough) Aliases() []string { |
| 24 |
return []string{"toggle-key-passthrough"} |
| 25 |
} |
| 26 |
|
| 27 |
func (ToggleKeyPassthrough) Execute(args []string) error { |
| 28 |
app.SetKeyPassthrough(!config.Viewer().KeyPassthrough) |
| 29 |
return nil |
| 30 |
} |