mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 15:34:53 +01:00
fix: insert at index 0, locked dep
This commit is contained in:
parent
f5a2412113
commit
f69d91b9f6
2 changed files with 2 additions and 11 deletions
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
codemp = { git = "ssh://git@github.com/codewithotherpeopleandchangenamelater/codemp.git", branch = "woot", features = ["global", "sync"] }
|
codemp = { git = "ssh://git@github.com/codewithotherpeopleandchangenamelater/codemp.git", rev = "486999bc31b8a925d56ee6d3747b06fcd97b00d5", features = ["global", "sync"] }
|
||||||
mlua = { version = "0.9.0", features = ["module", "luajit"] }
|
mlua = { version = "0.9.0", features = ["module", "luajit"] }
|
||||||
thiserror = "1.0.47"
|
thiserror = "1.0.47"
|
||||||
derive_more = "0.99.17"
|
derive_more = "0.99.17"
|
||||||
|
|
|
@ -197,6 +197,7 @@ vim.api.nvim_create_user_command(
|
||||||
if tick <= codemp_changed_tick then return end
|
if tick <= codemp_changed_tick then return end
|
||||||
local start = vim.api.nvim_buf_get_offset(buf, firstline)
|
local start = vim.api.nvim_buf_get_offset(buf, firstline)
|
||||||
local content = table.concat(vim.api.nvim_buf_get_lines(buf, firstline, new_lastline, false), '\n')
|
local content = table.concat(vim.api.nvim_buf_get_lines(buf, firstline, new_lastline, false), '\n')
|
||||||
|
if start == -1 then start = 0 end
|
||||||
if new_lastline < lastline then old_byte_size = old_byte_size + 1 end
|
if new_lastline < lastline then old_byte_size = old_byte_size + 1 end
|
||||||
controller:send(start, start + old_byte_size - 1, content)
|
controller:send(start, start + old_byte_size - 1, content)
|
||||||
end
|
end
|
||||||
|
@ -206,16 +207,6 @@ vim.api.nvim_create_user_command(
|
||||||
register_controller_handler(args.args, controller, function(event)
|
register_controller_handler(args.args, controller, function(event)
|
||||||
codemp_changed_tick = vim.api.nvim_buf_get_changedtick(buffer) + 1
|
codemp_changed_tick = vim.api.nvim_buf_get_changedtick(buffer) + 1
|
||||||
buffer_set_content(buffer, event.content)
|
buffer_set_content(buffer, event.content)
|
||||||
-- local start_row = vim.api.nvim_buf_get_offset(buffer, event.first)
|
|
||||||
-- local end_row = vim.api.nvim_buf_get_offset(buffer, event.last - 1)
|
|
||||||
-- vim.api.nvim_buf_set_text(
|
|
||||||
-- buffer,
|
|
||||||
-- start_row,
|
|
||||||
-- event.first - start_row,
|
|
||||||
-- end_row,
|
|
||||||
-- event.last - end_row,
|
|
||||||
-- vim.fn.split(event.content, '\n', true)
|
|
||||||
-- )
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
print(" ++ joined workspace " .. args.args)
|
print(" ++ joined workspace " .. args.args)
|
||||||
|
|
Loading…
Reference in a new issue