mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2025-04-07 19:21:32 +02:00
fix: print error when failed loading
also move back loading out of setup
This commit is contained in:
parent
f031ee8d5b
commit
e7dc51c79c
2 changed files with 9 additions and 8 deletions
lua/codemp
|
@ -28,14 +28,6 @@ if CODEMP == nil then
|
|||
password = "",
|
||||
},
|
||||
setup = function (opts)
|
||||
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")
|
||||
return CODEMP
|
||||
end
|
||||
end
|
||||
|
||||
CODEMP.config = vim.tbl_extend('force', CODEMP.config, opts)
|
||||
-- register logger
|
||||
CODEMP.native.setup_tracing(CODEMP.config.debug_file or print, CODEMP.config.debug)
|
||||
|
@ -78,4 +70,12 @@ if CODEMP == nil then
|
|||
}
|
||||
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")
|
||||
return CODEMP
|
||||
end
|
||||
end
|
||||
|
||||
return CODEMP
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
local function load()
|
||||
local ok, native = pcall(require, "codemp.native")
|
||||
if ok then return native end
|
||||
print(native)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue