fix error handling of custom/init.lua (#739)
This commit is contained in:
parent
b9fcaf610f
commit
c2a1298ac0
12
init.lua
12
init.lua
|
@ -14,8 +14,12 @@ end
|
||||||
-- non plugin mappings
|
-- non plugin mappings
|
||||||
require("core.mappings").misc()
|
require("core.mappings").misc()
|
||||||
|
|
||||||
-- try to call custom init
|
-- check if custom init.lua file exists
|
||||||
local ok, err = pcall(require, "custom")
|
if vim.fn.filereadable(vim.fn.stdpath "config" .. "/lua/custom/init.lua") == 1 then
|
||||||
if not ok then
|
-- try to call custom init, if not successful, show error
|
||||||
vim.notify("Error loading custom/init.lua\n\n" .. err)
|
local ok, err = pcall(require, "custom")
|
||||||
|
if not ok then
|
||||||
|
vim.notify("Error loading custom/init.lua\n\n" .. err)
|
||||||
|
end
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue