diff options
| author | phanium <91544758+phanen@users.noreply.github.com> | 2025-08-27 23:12:17 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-27 17:12:17 +0200 |
| commit | cd7cf4bd16e79f3b8b28a8a86580d45b3cd151d4 (patch) | |
| tree | 29af1d906a7810ca2fa8be4dd78cae901937afe6 /runtime/lua/vim/_extui | |
| parent | 9269a1da355b760f5da66a5d2ee7eaad7399848d (diff) | |
fix(extui): error on :call input('') (#35515)
Problem: Error on empty string prompt.
Solution: (prompt .. '\n'):gmatch('(.-)\n').
Diffstat (limited to 'runtime/lua/vim/_extui')
| -rw-r--r-- | runtime/lua/vim/_extui/cmdline.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/_extui/cmdline.lua b/runtime/lua/vim/_extui/cmdline.lua index 12584dc26b..f58ebb5910 100644 --- a/runtime/lua/vim/_extui/cmdline.lua +++ b/runtime/lua/vim/_extui/cmdline.lua @@ -41,7 +41,7 @@ local promptlen = 0 -- Current length of the last line in the prompt. ---@param prompt string local function set_text(content, prompt) local lines = {} ---@type string[] - for line in prompt:gmatch('[^\n]+') do + for line in (prompt .. '\n'):gmatch('(.-)\n') do lines[#lines + 1] = fn.strtrans(line) end cmdbuff, promptlen, M.erow = '', #lines[#lines], M.srow + #lines - 1 |
