diff --git a/lua/love2d/init.lua b/lua/love2d/init.lua index be938dd..e36dd96 100644 --- a/lua/love2d/init.lua +++ b/lua/love2d/init.lua @@ -15,7 +15,6 @@ love2d.find_src_path = function(path) main = vim.fn.findfile("main.lua", path) end if main == "" then - vim.notify("No main.lua file found", vim.log.levels.ERROR) return end return vim.fn.fnamemodify(main, ":h") diff --git a/plugin/love2d.lua b/plugin/love2d.lua index f75369c..3a34d12 100644 --- a/plugin/love2d.lua +++ b/plugin/love2d.lua @@ -3,6 +3,8 @@ vim.api.nvim_create_user_command("LoveRun", function(args) local path = love2d.find_src_path(args.args) if path then love2d.run(path) + else + vim.notify("No main.lua file found", vim.log.levels.ERROR) end end, { nargs = "?", complete = "dir" })