Commit Graph

6 Commits

Author SHA1 Message Date
Moritz Poldrack aaf0a0c656 lint: apply new formatting rules
Run `make fmt`.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-01 10:44:52 +02:00
Sergey Smirnykh 12e8217d1f commands: implement prompt completion
This patch implements :prompt completion.
The completion mechanism only provides completions when there is at least
one argument specified (prompt text).
The mechanism is based on other commands' completions and works as follows:

   1. Attempts to look up a command by the name specified in args[1].

   2.a On success it uses command.Complete.

   2.b Otherwise, if total arguments count is lesser or equals than 2
       (i.e. no command arguments specified), it attempts to complete
       the command's name.

Additional effort is made to preserve prompt text, which often contains
spaces and formatting.

Signed-off-by: Sergey Smirnykh <sergey.smirnykh@siborgium.xyz>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-02 18:36:40 +02:00
Robin Jarry 0d645bcebd go.mod: change base git url
I'm not sure what are the implications but it seems required.

Link: https://github.com/golang/go/issues/20883
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05 10:21:45 +01:00
Wagner Riffel feacca3c5c all: use fmt.Errorf for fomartting errors
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
2019-09-04 16:30:57 -10:00
Wagner Riffel 6838c23478 all: purge redundant underscores
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
2019-09-04 16:30:57 -10:00
Christopher Vittal ecd803aae4 Add :prompt command
Usage:
    :prompt <prompt> <command...>

Displays the prompt on the status bar, waits for user input, then
appends that input as the last argument to the command and executes it.
The input is passed as one argument to the command, unless it is empty,
in which case no extra argument is added.
2019-08-26 09:48:39 +09:00