Skip to content

Commit

Permalink
fix: bad default value handling in vim.ui.input
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Feb 24, 2023
1 parent 55fd604 commit 5f44f82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/dressing/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ setmetatable(M, {
end

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

0 comments on commit 5f44f82

Please sign in to comment.