From eb240ec6fc54adb694d63213848750bd65fbf52b Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 27 Sep 2024 23:46:35 +0200 Subject: [PATCH] fix: skip existing check for share commands --- lua/codemp/command.lua | 2 +- lua/codemp/neo-tree/commands.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/codemp/command.lua b/lua/codemp/command.lua index fb8f772..8546e68 100644 --- a/lua/codemp/command.lua +++ b/lua/codemp/command.lua @@ -104,7 +104,7 @@ local joined_actions = { local buf = vim.api.nvim_get_current_buf() if not bang then buffers.create(path) end local content = utils.buffer.get_content(buf) - buffers.attach(path, { buffer = buf, content = content }) + buffers.attach(path, { buffer = buf, content = content, skip_exists_check = true }) require('codemp.window').update() -- TODO would be nice to do automatically inside else print(" !! empty path or open a file") diff --git a/lua/codemp/neo-tree/commands.lua b/lua/codemp/neo-tree/commands.lua index 2ff5a74..1d8f949 100644 --- a/lua/codemp/neo-tree/commands.lua +++ b/lua/codemp/neo-tree/commands.lua @@ -91,7 +91,7 @@ M.move = function(state, path, extra) if not input or not vim.startswith(string.lower(input), "y") then return end local window = utils.get_appropriate_window(state) local buf = vim.api.nvim_win_get_buf(window) - buf_manager.attach(selected.name, { buffer = buf }) + buf_manager.attach(selected.name, { buffer = buf, skip_exists_check = true }) end) end error("only buffers can be moved to current file") @@ -105,7 +105,7 @@ M.copy = function(state, path, extra) local window = utils.get_appropriate_window(state) local buf = vim.api.nvim_win_get_buf(window) local content = codemp_utils.buffer.get_content(buf) - buf_manager.attach(selected.name, { buffer = buf, content = content }) + buf_manager.attach(selected.name, { buffer = buf, content = content, skip_exists_check = true }) end) end error("current file can only be copied into buffers")