mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 07:24:52 +01:00
fix: better prompts for add
This commit is contained in:
parent
f6561ad361
commit
d9f4446fc9
1 changed files with 3 additions and 3 deletions
|
@ -124,20 +124,20 @@ M.add = function(state, path, extra)
|
||||||
local selected = state.tree:get_node()
|
local selected = state.tree:get_node()
|
||||||
if selected.type == "root" then
|
if selected.type == "root" then
|
||||||
if vim.startswith(selected.name, "#") then
|
if vim.startswith(selected.name, "#") then
|
||||||
vim.ui.input({ prompt = "buffer path" }, function(input)
|
vim.ui.input({ prompt = "new buffer path" }, function(input)
|
||||||
if input == nil or input == "" then return end
|
if input == nil or input == "" then return end
|
||||||
session.workspace:create_buffer(input):await()
|
session.workspace:create_buffer(input):await()
|
||||||
manager.refresh("codemp")
|
manager.refresh("codemp")
|
||||||
end)
|
end)
|
||||||
elseif selected.name == "workspaces" then
|
elseif selected.name == "workspaces" then
|
||||||
vim.ui.input({ prompt = "workspace name" }, function(input)
|
vim.ui.input({ prompt = "new workspace name" }, function(input)
|
||||||
if input == nil or input == "" then return end
|
if input == nil or input == "" then return end
|
||||||
session.client:create_workspace(input):await()
|
session.client:create_workspace(input):await()
|
||||||
manager.refresh("codemp")
|
manager.refresh("codemp")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
elseif selected.type == "workspace" then
|
elseif selected.type == "workspace" then
|
||||||
vim.ui.input({ prompt = "user name" }, function(input)
|
vim.ui.input({ prompt = "user name to invite" }, function(input)
|
||||||
if input == nil or input == "" then return end
|
if input == nil or input == "" then return end
|
||||||
session.client:invite_to_workspace(selected.name, input):await()
|
session.client:invite_to_workspace(selected.name, input):await()
|
||||||
print("invited user " .. input .. " to workspace " .. selected.name)
|
print("invited user " .. input .. " to workspace " .. selected.name)
|
||||||
|
|
Loading…
Reference in a new issue