diff options
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/doc/builtin.txt | 8 | ||||
| -rw-r--r-- | runtime/doc/news.txt | 5 | ||||
| -rw-r--r-- | runtime/lua/vim/_meta/vimfn.lua | 8 |
3 files changed, 21 insertions, 0 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 3d9010aa2c..96574e2899 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -3114,6 +3114,14 @@ getchar([{expr} [, {opts}]]) *getchar()* The optional argument {opts} is a Dict and supports the following items: + cursor A String specifying cursor behavior + when waiting for a character. + "hide": hide the cursor. + "keep": keep current cursor unchanged. + "msg": move cursor to message area. + (default: automagically decide + between "keep" and "msg") + number If |TRUE|, return a Number when getting a single character. If |FALSE|, the return value is always diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 2208428f75..eda8d945cb 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -410,6 +410,11 @@ UI • |:checkhealth| can display in a floating window, controlled by the |g:health| variable. +VIMSCRIPT + +• |getchar()| and |getcharstr()| have optional {opts} |Dict| argument to control: + cursor behavior, return type, and whether to simplify the returned key. + ============================================================================== CHANGED FEATURES *news-changed* diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index c0be6b089c..098c0e907a 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -2781,6 +2781,14 @@ function vim.fn.getchangelist(buf) end --- The optional argument {opts} is a Dict and supports the --- following items: --- +--- cursor A String specifying cursor behavior +--- when waiting for a character. +--- "hide": hide the cursor. +--- "keep": keep current cursor unchanged. +--- "msg": move cursor to message area. +--- (default: automagically decide +--- between "keep" and "msg") +--- --- number If |TRUE|, return a Number when getting --- a single character. --- If |FALSE|, the return value is always |