fix: new attach() usage

This commit is contained in:
əlemi 2024-09-27 23:04:56 +02:00
parent a001a96abf
commit 14286f1699
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 3 additions and 3 deletions

View file

@ -104,7 +104,7 @@ local joined_actions = {
local buf = vim.api.nvim_get_current_buf() local buf = vim.api.nvim_get_current_buf()
if not bang then buffers.create(path) end if not bang then buffers.create(path) end
local content = utils.buffer.get_content(buf) local content = utils.buffer.get_content(buf)
buffers.attach(path, buf, content) buffers.attach(path, { buffer = buf, content = content })
require('codemp.window').update() -- TODO would be nice to do automatically inside require('codemp.window').update() -- TODO would be nice to do automatically inside
else else
print(" !! empty path or open a file") print(" !! empty path or open a file")

View file

@ -91,7 +91,7 @@ M.move = function(state, path, extra)
if not input or not vim.startswith(string.lower(input), "y") then return end if not input or not vim.startswith(string.lower(input), "y") then return end
local window = utils.get_appropriate_window(state) local window = utils.get_appropriate_window(state)
local buf = vim.api.nvim_win_get_buf(window) local buf = vim.api.nvim_win_get_buf(window)
buf_manager.attach(selected.name, buf) buf_manager.attach(selected.name, { buffer = buf })
end) end)
end end
error("only buffers can be moved to current file") 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 window = utils.get_appropriate_window(state)
local buf = vim.api.nvim_win_get_buf(window) local buf = vim.api.nvim_win_get_buf(window)
local content = codemp_utils.buffer.get_content(buf) local content = codemp_utils.buffer.get_content(buf)
buf_manager.attach(selected.name, buf, content) buf_manager.attach(selected.name, { buffer = buf, content = content })
end) end)
end end
error("current file can only be copied into buffers") error("current file can only be copied into buffers")