Debian Codegraph @

commands/pin-tab.go

raw
1 package commands
2
3 import (
4 "git.sr.ht/~rjarry/aerc/app"
5 )
6
7 type PinTab struct{}
8
9 func init() {
10 Register(PinTab{})
11 }
12
13 func (PinTab) Description() string {
14 return "Move the current tab to the left and mark it as pinned."
15 }
16
17 func (PinTab) Context() CommandContext {
18 return GLOBAL
19 }
20
21 func (PinTab) Aliases() []string {
22 return []string{"pin-tab", "unpin-tab"}
23 }
24
25 func (PinTab) Execute(args []string) error {
26 switch args[0] {
27 case "pin-tab":
28 app.PinTab()
29 case "unpin-tab":
30 app.UnpinTab()
31 }
32
33 return nil
34 }