fix(scratch): make sure win.opts.keys exists. See #190

This commit is contained in:
Folke Lemaitre 2024-12-03 09:18:08 +01:00
parent 630d96cf1f
commit 50bd5103ba
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -232,6 +232,7 @@ function M.open(opts)
local function reset()
vim.api.nvim_buf_set_lines(buf, 0, -1, false, vim.split(opts.template, "\n"))
end
opts.win.keys = opts.win.keys or {}
opts.win.keys.reset = { "R", reset, desc = "Reset buffer" }
if is_new then
reset()