From 2176d32540ad00e69d219051639434bdd11b003c Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 6 Sep 2024 15:13:36 +0200 Subject: [PATCH] fix: added back create function --- lua/codemp/buffers.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) 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,