Closed jakebrinkmann closed 6 months ago
:shrug: this seems to work, IDK if it's "correct" :shrug:
diff --git a/lua/esqueleto/utils.lua b/lua/esqueleto/utils.lua
index 41949d1..1524c3d 100644
--- a/lua/esqueleto/utils.lua
+++ b/lua/esqueleto/utils.lua
@@ -170,7 +170,9 @@ M.selecttemplate = function(templates, opts)
-- Select template
vim.ui.select(templatenames, { prompt = "Select skeleton to use:" }, function(choice)
- M.writetemplate(vim.loop.fs_realpath(templates[choice]), opts)
+ if templates[choice] then
+ M.writetemplate(vim.loop.fs_realpath(templates[choice]), opts)
+ end
end)
end
Hi @jakebrinkmann! Thanks for the issue and pull request.
I left it like that to raise an error on empty directories on purpose, but maybe its time to make this part fail more graciously.
I will add some thigs to you PR and push it to the main branch. Thanks for your contribution!
Hello, I am not a strong lua/neovim developer, otherwise I would dig into this and find a fix.