chore: less stuff on setup return

This commit is contained in:
əlemi 2024-09-05 05:44:26 +02:00
parent cce2cc5a37
commit 3c3c1fd7c4
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -3,12 +3,12 @@ local session = nil
local native = nil
local timer = nil
local function setup(opts)
local function setup(_opts)
local path = vim.fn.stdpath('data') .. '/codemp/'
if vim.fn.isdirectory(path) == 0 then
vim.fn.mkdir(path, 'p')
end
if native == nil then
native = require('codemp.loader').load() -- make sure we can load the native library correctly, otherwise no point going forward
--native.logger(function (msg)
@ -35,9 +35,9 @@ local function setup(opts)
}
)
end
local timer_interval = vim.g.codemp_callback_interval or 100
if timer == nil then
timer = vim.loop.new_timer()
timer:start(timer_interval, timer_interval, function()
@ -54,11 +54,6 @@ local function setup(opts)
return {
native = native,
session = session,
buffers = require('codemp.buffers'),
workspace = require('codemp.workspace'),
window = require('codemp.window'),
utils = require('codemp.utils'),
logger = native.logger,
rt = rt,
callbacks_timer = timer,
}