mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-25 00:44:52 +01:00
17 lines
644 B
Lua
17 lines
644 B
Lua
local native = require("codemp.loader").load()
|
|
local window = require("codemp.window")
|
|
local session = require("codemp.session")
|
|
local workspace = require("codemp.workspace")
|
|
|
|
local function connect(host, username, password)
|
|
if host == nil then host = 'http://codemp.dev:50053' end
|
|
if username == nil then username = vim.g.codemp_username or vim.fn.input("username > ", "") end
|
|
if password == nil then password = vim.g.codemp_password or vim.fn.input("password > ", "") end
|
|
session.client = native.connect(host, username, password):await()
|
|
window.update()
|
|
vim.schedule(function () workspace.list() end)
|
|
end
|
|
|
|
return {
|
|
connect = connect
|
|
}
|