codemp-nvim/lua/codemp/client.lua

24 lines
667 B
Lua
Raw Permalink Normal View History

2024-08-24 01:57:00 +02:00
local workspace = require("codemp.workspace")
2024-09-16 18:27:23 +02:00
local function connect()
---@type Config
local tmp_cfg = vim.tbl_extend('force', {}, CODEMP.config)
if tmp_cfg.username == nil or #tmp_cfg.username == 0 then
tmp_cfg.username = vim.g.codemp_username or vim.fn.input("username > ", "")
2024-09-16 18:27:23 +02:00
end
if tmp_cfg.password == nil or #tmp_cfg.password == 0 then
tmp_cfg.password = vim.g.codemp_password or vim.fn.input("password > ", "")
2024-09-16 18:27:23 +02:00
end
print(" -- connecting ...")
CODEMP.native.connect(tmp_cfg):and_then(function (client)
print(" ++ connected")
CODEMP.client = client
2024-09-17 16:33:22 +02:00
require('codemp.window').update()
workspace.list()
end)
2024-08-24 01:57:00 +02:00
end
return {
connect = connect
}