codemp-nvim/lua/codemp/client.lua

22 lines
555 B
Lua
Raw 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 not tmp_cfg.username then
tmp_cfg.username = vim.g.codemp_username or vim.fn.input("username > ", "")
2024-09-16 18:27:23 +02:00
end
if not tmp_cfg.password then
tmp_cfg.password = vim.g.codemp_password or vim.fn.input("password > ", "")
2024-09-16 18:27:23 +02:00
end
CODEMP.native.connect(tmp_cfg):and_then(function (client)
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
}