summary refs log tree commit diff stats
path: root/widgets/aerc.go
diff options
context:
space:
mode:
authorGreg Anders <greg@gpanders.com>2019-11-15 13:28:34 -0700
committerDrew DeVault <sir@cmpwn.com>2019-11-17 13:19:13 -0500
commit4bdef7d8609aa2d382fa74018e28ccb176276615 (patch)
treeef22e1ef17c3247de6531715c7502a3a3d313867 /widgets/aerc.go
parent809083f8438401e2ee1d2d14712677f55eb4e4ef (diff)
downloadaerc-4bdef7d8609aa2d382fa74018e28ccb176276615.tar.gz
Add UI options to save/pipe messages with unsupported mimetypes
Adds a message indicating the user's ability to :save or :pipe a message
with an unsupported mimetype and also adds a selector widget (similar to
the tutorial).

The selector widget was previously defined in the account wizard module,
so this commit breaks it out into its own module to allow for re-use.

Further, modify the BeginExLine() function to take an argument that
pre-populates the command line, allowing functions to initiate an ex
command without executing it.

Closes #95.
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r--widgets/aerc.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index d324908..9d955e1 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -240,7 +240,7 @@ func (aerc *Aerc) Event(event tcell.Event) bool {
 				exKey = aerc.conf.Bindings.Global.ExKey
 			}
 			if event.Key() == exKey.Key && event.Rune() == exKey.Rune {
-				aerc.BeginExCommand()
+				aerc.BeginExCommand("")
 				return true
 			}
 			interactive, ok := aerc.tabs.Tabs[aerc.tabs.Selected].Content.(ui.Interactive)
@@ -370,9 +370,9 @@ func (aerc *Aerc) focus(item ui.Interactive) {
 	}
 }
 
-func (aerc *Aerc) BeginExCommand() {
+func (aerc *Aerc) BeginExCommand(cmd string) {
 	previous := aerc.focused
-	exline := NewExLine(func(cmd string) {
+	exline := NewExLine(cmd, func(cmd string) {
 		parts, err := shlex.Split(cmd)
 		if err != nil {
 			aerc.PushStatus(" "+err.Error(), 10*time.Second).