From 9e48af37fe7eb945933a4bd0b87217de801f7b4c Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 26 Sep 2024 03:42:06 +0200 Subject: [PATCH] feat: allow detaching from buffers with 'a' not really the best key but better than nothing i guess... --- lua/codemp/neo-tree/commands.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/codemp/neo-tree/commands.lua b/lua/codemp/neo-tree/commands.lua index ece75ea..67b7d0f 100644 --- a/lua/codemp/neo-tree/commands.lua +++ b/lua/codemp/neo-tree/commands.lua @@ -164,6 +164,15 @@ M.add = function(state, path, extra) print("invited user " .. input .. " to workspace " .. selected.name) 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