From f4d5d5250a105b5593e3119f4ee37ea20272a34b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 1 Apr 2017 23:57:34 +0300 Subject: eval: Refactor get_user_input to support dictionary --- runtime/doc/eval.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 911fe43819..5a2db1825f 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4665,10 +4665,23 @@ index({list}, {expr} [, {start} [, {ic}]]) *index()* input({prompt} [, {text} [, {completion}]]) *input()* +input({opts}) The result is a String, which is whatever the user typed on the command-line. The {prompt} argument is either a prompt string, or a blank string (for no prompt). A '\n' can be used in the prompt to start a new line. + + In the second form it accepts a single dictionary with the + following keys, any of which may be omitted: + + Key Default Description ~ + prompt "" Same as {prompt} in the first form. + default "" Same as {text} in the first form. + completion nothing Same as {completion} in the first form. + cancelreturn "" Same as {cancelreturn} from + |inputdialog()|. Also works with + input(). + The highlighting set with |:echohl| is used for the prompt. The input is entered just like a command-line, with the same editing commands and mappings. There is a separate history @@ -4710,6 +4723,7 @@ input({prompt} [, {text} [, {completion}]]) *input()* :endfunction inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* +inputdialog({opts}) Like |input()|, but when the GUI is running and text dialogs are supported, a dialog window pops up to input the text. Example: > @@ -4721,7 +4735,7 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* omitted an empty string is returned. Hitting works like pressing the OK button. Hitting works like pressing the Cancel button. - NOTE: Command-line completion is not supported. + NOTE: Command-line completion is not supported in the GUI. inputlist({textlist}) *inputlist()* {textlist} must be a |List| of strings. This |List| is -- cgit From 475cd8f0750e16863ab049b3a192a9081ee7c986 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 8 Apr 2017 21:24:15 +0300 Subject: doc: Do not assume something is not supported in GUI --- runtime/doc/eval.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5a2db1825f..873200cb30 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4735,7 +4735,6 @@ inputdialog({opts}) omitted an empty string is returned. Hitting works like pressing the OK button. Hitting works like pressing the Cancel button. - NOTE: Command-line completion is not supported in the GUI. inputlist({textlist}) *inputlist()* {textlist} must be a |List| of strings. This |List| is -- cgit From d01f140bb3d926486014ae6697c8a7cef241325b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 13 May 2017 18:16:41 +0300 Subject: doc: Add a note to vim_diff.txt --- runtime/doc/vim_diff.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index e6184fd528..ca2ab836b8 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -244,6 +244,10 @@ Lua interface (|if_lua.txt|): - Lua has direct access to Neovim api via `vim.api`. - Currently most of features are missing. +|input()| and |inputdialog()| gained support for each other’s features (return +on cancel and completion respectively) via dictionary argument (replaces all +other arguments if used). + ============================================================================== 5. Missing legacy features *nvim-features-missing* *if_lua* *if_perl* *if_mzscheme* *if_tcl* -- cgit