mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-21 15:04: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()
|
||||
---@type 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 > ", "")
|
||||
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 > ", "")
|
||||
end
|
||||
CODEMP.native.connect(tmp_cfg):and_then(function (client)
|
||||
print(" ++ connected")
|
||||
CODEMP.client = client
|
||||
require('codemp.window').update()
|
||||
workspace.list()
|
||||
|
|
|
@ -25,7 +25,6 @@ local base_actions = {
|
|||
|
||||
connect = function()
|
||||
client.connect()
|
||||
print(" ++ connected")
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue