fix: buffers command, some ux in cmds

This commit is contained in:
əlemi 2024-09-16 20:46:10 +02:00
parent 493f599ec2
commit 06fa78e6cc
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -20,8 +20,9 @@ local base_actions = {
require('codemp.window').toggle() require('codemp.window').toggle()
end, end,
connect = function(host) connect = function()
client.connect(host) client.connect()
print(" ++ connected")
end, end,
} }
@ -107,7 +108,13 @@ local joined_actions = {
end, end,
buffers = function() buffers = function()
workspace.open_buffer_tree() for _, buf in ipairs(session.workspace:filetree()) do
if buffers.map_rev[buf] ~= nil then
print(" +- " .. buf)
else
print(" -- " .. buf)
end
end
end, end,
sync = function() sync = function()
@ -204,10 +211,10 @@ vim.api.nvim_create_user_command(
elseif stage == 3 then elseif stage == 3 then
if args[#args-1] == 'attach' or args[#args-1] == 'detach' then if args[#args-1] == 'attach' or args[#args-1] == 'detach' then
if session.client ~= nil and session.workspace ~= nil then if session.client ~= nil and session.workspace ~= nil then
if session.workspace ~= nil then
return filter(lead, session.workspace:filetree()) return filter(lead, session.workspace:filetree())
end end
end elseif args[#args-1] == 'join' then
return filter(lead, session.available)
end end
return {} return {}