fix: sending change across multiple lines

This commit is contained in:
əlemi 2024-09-09 02:37:50 +02:00
parent 27ad9fe773
commit 3f5ce44b96
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -45,8 +45,11 @@ local function attach(name, buffer, content, nowait)
if new_byte_len == 0 then
change_content = ""
else
local actual_end_row = start_row + new_end_row
local actual_end_col = new_end_col
if new_end_row == 0 then actual_end_col = new_end_col + start_col end
change_content = table.concat(
vim.api.nvim_buf_get_text(buf, start_row, start_col, start_row + new_end_row, start_col + new_end_col, {}),
vim.api.nvim_buf_get_text(buf, start_row, start_col, actual_end_row, actual_end_col, {}),
'\n'
)
end