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. --- lib/ui/textinput.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/ui') diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index 3935173..e81e836 100644 --- a/lib/ui/textinput.go +++ b/lib/ui/textinput.go @@ -63,9 +63,10 @@ func (ti *TextInput) StringRight() string { return string(ti.text[ti.index:]) } -func (ti *TextInput) Set(value string) { +func (ti *TextInput) Set(value string) *TextInput { ti.text = []rune(value) ti.index = len(ti.text) + return ti } func (ti *TextInput) Invalidate() { -- cgit v1.2.3