diff options
author | 0x74696d6d79 <34635512+tzx@users.noreply.github.com> | 2022-06-28 05:53:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 02:53:15 -0700 |
commit | ee6b21e8430ea810ba2e3e9163b941386a2e1d65 (patch) | |
tree | 144e681d0e7fc79107dcbffb91a2eed6bd5a25cf /runtime/lua/vim/ui.lua | |
parent | 014a88799a1d175ad121c520c9cc5bd0bb2d8813 (diff) | |
download | rneovim-ee6b21e8430ea810ba2e3e9163b941386a2e1d65.tar.gz rneovim-ee6b21e8430ea810ba2e3e9163b941386a2e1d65.tar.bz2 rneovim-ee6b21e8430ea810ba2e3e9163b941386a2e1d65.zip |
fix(vim.ui.input): accept nil or empty "opts" #19109
Fix #18143
Diffstat (limited to 'runtime/lua/vim/ui.lua')
-rw-r--r-- | runtime/lua/vim/ui.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua index 77bca7f6c4..6f1ce3089d 100644 --- a/runtime/lua/vim/ui.lua +++ b/runtime/lua/vim/ui.lua @@ -59,7 +59,7 @@ end --- ---@param opts table Additional options. See |input()| --- - prompt (string|nil) ---- Text of the prompt. Defaults to `Input: `. +--- Text of the prompt --- - default (string|nil) --- Default reply to the input --- - completion (string|nil) @@ -87,7 +87,7 @@ function M.input(opts, on_confirm) on_confirm = { on_confirm, 'function', false }, }) - opts = opts or {} + opts = (opts and not vim.tbl_isempty(opts)) and opts or vim.empty_dict() local input = vim.fn.input(opts) if #input > 0 then on_confirm(input) |