From c2fb1fc700db28cb554be9da8e79443b5d3a5fe9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 24 Sep 2024 06:51:02 +0800 Subject: vim-patch:9.1.0741: No way to get prompt for input()/confirm() Problem: No way to get prompt for input()/confirm() Solution: add getcmdprompt() function (Shougo Matsushita) (Shougo Matsushita) closes: vim/vim#15667 https://github.com/vim/vim/commit/6908428560a0d6ae27bf7af6fcb6dc362e31926c Co-authored-by: Shougo Matsushita --- runtime/lua/vim/_meta/vimfn.lua | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'runtime/lua/vim/_meta/vimfn.lua') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 70a7503aac..649805f447 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -2883,20 +2883,20 @@ function vim.fn.getcharstr(expr) end --- Only works when the command line is being edited, thus --- requires use of |c_CTRL-\_e| or |c_CTRL-R_=|. --- See |:command-completion| for the return string. ---- Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()| and ---- |setcmdline()|. +--- Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|, +--- |getcmdprompt()| and |setcmdline()|. --- Returns an empty string when completion is not defined. --- --- @return string function vim.fn.getcmdcompltype() end ---- Return the current command-line. Only works when the command ---- line is being edited, thus requires use of |c_CTRL-\_e| or ---- |c_CTRL-R_=|. +--- Return the current command-line input. Only works when the +--- command line is being edited, thus requires use of +--- |c_CTRL-\_e| or |c_CTRL-R_=|. --- Example: >vim --- cmap eescape(getcmdline(), ' \') ----