fix: only register cmds once, dont create dir

This commit is contained in:
əlemi 2024-09-06 19:25:15 +02:00
parent 9873617742
commit 6e817b3e6d
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -13,11 +13,6 @@ if CODEMP == nil then
setup = function (opts) setup = function (opts)
CODEMP.config = vim.tbl_extend('force', CODEMP.config, opts) CODEMP.config = vim.tbl_extend('force', CODEMP.config, opts)
local path = vim.fn.stdpath('data') .. '/codemp/'
if vim.fn.isdirectory(path) == 0 then
vim.fn.mkdir(path, 'p')
end
if CODEMP.native == nil then 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 CODEMP.native = require('codemp.loader').load() -- make sure we can load the native library correctly, otherwise no point going forward
--CODEMP.native.logger(function (msg) --CODEMP.native.logger(function (msg)
@ -54,9 +49,10 @@ if CODEMP == nil then
cb() cb()
end end
end) end)
require('codemp.command') -- not really related but should only happen once
end end
require('codemp.command')
return CODEMP return CODEMP
end, end,