Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit 5f44f82

Browse files
committed
fix: bad default value handling in vim.ui.input
1 parent 55fd604 commit 5f44f82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/dressing/input.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ setmetatable(M, {
322322
end
323323

324324
vim.api.nvim_buf_set_option(bufnr, "filetype", "DressingInput")
325-
vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, { string.gsub(opts.default or "", "\n", " ") })
325+
local default = string.gsub(opts.default or "", "\n", " ")
326+
vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, { default })
326327
util.add_title_to_win(
327328
winid,
328329
string.gsub(prompt, "^%s*(.-)%s*$", "%1"),

0 commit comments

Comments
 (0)