diff --git a/lua/codemp/buffers.lua b/lua/codemp/buffers.lua index 9f919b5..e81e08c 100644 --- a/lua/codemp/buffers.lua +++ b/lua/codemp/buffers.lua @@ -125,11 +125,22 @@ local function sync(buffer) print(" !! buffer not managed") end +local function create(buffer) + if buffer == nil then + buffer = vim.fn.expand("%p") + end + if session.workspace == nil then + error("join a workspace first") + end + session.workspace:create_buffer(buffer):await() +end + return { sync = sync, attach = attach, detach = detach, + create = create, map = id_buffer_map, map_rev = buffer_id_map, ticks = ticks,