diff --git a/lua/codemp/init.lua b/lua/codemp/init.lua index 518eb33..9800855 100644 --- a/lua/codemp/init.lua +++ b/lua/codemp/init.lua @@ -18,6 +18,9 @@ end if CODEMP.native == nil then CODEMP.native = require('codemp.loader').load() -- make sure we can load the native library correctly, otherwise no point going forward + if CODEMP.native == nil then + print(" !! could not load native bindings, try reloading") + end --CODEMP.native.logger(function (msg) -- vim.schedule(function () print(msg) end) --end, true) diff --git a/lua/codemp/loader.lua b/lua/codemp/loader.lua index 6619a8f..75de3cf 100644 --- a/lua/codemp/loader.lua +++ b/lua/codemp/loader.lua @@ -1,9 +1,10 @@ ---@module 'annotations' ----@return Codemp +---@return Codemp? local function load() - local native, _ = require("codemp.native") - return native + local ok, native = pcall(require, "codemp.native") + if ok then return native end + return nil end return {