feat: allow detaching from buffers with 'a'

not really the best key but better than nothing i guess...
This commit is contained in:
əlemi 2024-09-26 03:42:06 +02:00
parent 2d41812e23
commit 9e48af37fe
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -164,6 +164,15 @@ M.add = function(state, path, extra)
print("invited user " .. input .. " to workspace " .. selected.name) print("invited user " .. input .. " to workspace " .. selected.name)
end) end)
end) end)
elseif selected.type == "buffer" then
if buf_manager.map_rev[selected.name] ~= nil then
vim.ui.input({ prompt = "detach from '" .. selected.name .. "'?" }, function (choice)
if not vim.startswith(string.lower(choice), "y") then return end
if not CODEMP.workspace:detach(selected.name) then
print(" /!\\ dangling reference, detach incomplete")
end
end)
end
end end
end end