aboutsummaryrefslogtreecommitdiff
path: root/lib/ui/textinput.go
AgeCommit message (Collapse)Author
2020-01-09compose: don't call ti.tabcomplete when it is nilTimmy Douglas
2020-01-05Don't select completions until tab has been pressedBen Burwell
Before, pressing <Enter> when completions were visible would execute the selected completion. As soon as completions were provided, the first item would be selected. This could cause issues e.g. when changing folders: :cf <Enter> Previously, this would have selected the first folder in the list. Now, since <Tab>, <C-n>, etc have not been pressed to select the first completion, the command above simply executes `:cf `. To accomplish this, a "no-op completion" has been added at index -1.
2019-12-21Show textinput completions in popoversBen Burwell
Rather than showing completions inline in the text input, show them in a popover which can be scrolled by repeatedly pressing the tab key. The selected completion can be executed by pressing enter.
2019-11-17Add UI options to save/pipe messages with unsupported mimetypesGreg Anders
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.
2019-09-11Add MouseableJeffas
This adds the Mouseable interface. When this is implemented for a component that item can accept and process mouseevents. At the top level when a mouse event is received it is passed to the grid's handler and then it trickles down until it reaches a component that can actually handle it, such as the tablist, dirlist or msglist. A mouse event is passed so that components can handle other things such as scrolling with the mousewheel. The components themselves then perform the necessary actions. Clicking emails in the messagelist opens them in a new tab. Textinputs can be clicked to position the cursor inside them. Mouseevents are not forwarded to the terminal at the moment. Elements which do not handle mouse events are not required to implement the Mouseable interface.
2019-08-12Add delete forward <C-k> and backward <C-u>Christopher Vittal
Choose the readline defaults for the behavior of these two functions/keybindings. Depending on the program, either of these can delete the whole line. Note that by default in [compose], <C-k> is bound to :prev-field<Enter>. Leave it up to the user whether or not they want to rebind the key in [compose].
2019-07-26Add tab completion to textinputsJeffas
This adds tab completion to textinput components. They can be configured with a completion function. This function is called when the user presses <tab>. The first completion is initially shown to the user inserted into the text. Repeated presses of <tab> or <backtab> cycle through the completions list. The completions list is invalidated when any other non-tab-like key is pressed. Also changed is some logic for current completion generation so that all available commands are returned when <tab> is pressed with no current text and similarly for arguments of commands.
2019-07-17Fix text input cursor position with non-ASCII textTuomas Siipola
Fixes #171
2019-06-29Implement basic tab completion supportGregory Mullen
Tab completion currently only works on commands. Contextual completion will be added in the future.
2019-05-25ensureScroll on text input framesDrew DeVault
2019-05-25Implement scrolling in text inputDrew DeVault
2019-05-22Show account wizard if no accounts configuredDrew DeVault
2019-05-21New account wizard, part oneDrew DeVault
2019-05-16Let caller pass in custom headers to composeDrew DeVault
2019-05-14Update tab name as subject changesDrew DeVault
Also moves truncation to the tab widget
2019-05-12Implement :{next,prev}-field in compose viewDrew DeVault
2019-05-12Add initial compose widgetDrew DeVault
2019-05-11Refactor ctx stashing out of exlineDrew DeVault
2019-05-11Split ex line text handling into dedicated widgetDrew DeVault