From 4bdef7d8609aa2d382fa74018e28ccb176276615 Mon Sep 17 00:00:00 2001 From: Greg Anders Date: Fri, 15 Nov 2019 13:28:34 -0700 Subject: 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. --- widgets/aerc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'widgets/aerc.go') 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). -- cgit 1.4.1-2-gfad0