mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 15:51:32 +00:00
fix(extui): error on :call input('') (#35515)
Problem: Error on empty string prompt.
Solution: (prompt .. '\n'):gmatch('(.-)\n').
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user