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/exline.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'widgets/exline.go') diff --git a/widgets/exline.go b/widgets/exline.go index 1482f0e..f2c7249 100644 --- a/widgets/exline.go +++ b/widgets/exline.go @@ -16,11 +16,11 @@ type ExLine struct { input *ui.TextInput } -func NewExLine(commit func(cmd string), finish func(), +func NewExLine(cmd string, commit func(cmd string), finish func(), tabcomplete func(cmd string) []string, cmdHistory lib.History) *ExLine { - input := ui.NewTextInput("").Prompt(":").TabComplete(tabcomplete) + input := ui.NewTextInput("").Prompt(":").TabComplete(tabcomplete).Set(cmd) exline := &ExLine{ commit: commit, finish: finish, -- cgit v1.2.3