mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-25 00:44:52 +01:00
fix: check for nil and empty string
empty string is not falsy in lua? idk
This commit is contained in:
parent
d524076412
commit
32e056de91
2 changed files with 3 additions and 3 deletions
|
@ -3,13 +3,14 @@ local workspace = require("codemp.workspace")
|
||||||
local function connect()
|
local function connect()
|
||||||
---@type Config
|
---@type Config
|
||||||
local tmp_cfg = vim.tbl_extend('force', {}, CODEMP.config)
|
local tmp_cfg = vim.tbl_extend('force', {}, CODEMP.config)
|
||||||
if not tmp_cfg.username then
|
if tmp_cfg.username == nil or #tmp_cfg.username == 0 then
|
||||||
tmp_cfg.username = vim.g.codemp_username or vim.fn.input("username > ", "")
|
tmp_cfg.username = vim.g.codemp_username or vim.fn.input("username > ", "")
|
||||||
end
|
end
|
||||||
if not tmp_cfg.password then
|
if tmp_cfg.password == nil or #tmp_cfg.password == 0 then
|
||||||
tmp_cfg.password = vim.g.codemp_password or vim.fn.input("password > ", "")
|
tmp_cfg.password = vim.g.codemp_password or vim.fn.input("password > ", "")
|
||||||
end
|
end
|
||||||
CODEMP.native.connect(tmp_cfg):and_then(function (client)
|
CODEMP.native.connect(tmp_cfg):and_then(function (client)
|
||||||
|
print(" ++ connected")
|
||||||
CODEMP.client = client
|
CODEMP.client = client
|
||||||
require('codemp.window').update()
|
require('codemp.window').update()
|
||||||
workspace.list()
|
workspace.list()
|
||||||
|
|
|
@ -25,7 +25,6 @@ local base_actions = {
|
||||||
|
|
||||||
connect = function()
|
connect = function()
|
||||||
client.connect()
|
client.connect()
|
||||||
print(" ++ connected")
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue