1
This commit is contained in:
Alex Yatskov 2024-04-26 23:01:16 -07:00
parent bbb57ff024
commit 2a35d6ab9d

View File

@ -431,7 +431,9 @@ function WrapContext:unwrap(opt)
local cursor = nil
for i, param in ipairs(self.params.parsed) do
if param:is_active() then
cursor = Cursor.new(0, #line + param.offset)
cursor = Cursor.get_current()
cursor.row = cursor.row - 1
cursor.col = #line + param.offset
end
line = line .. param.text
@ -445,12 +447,6 @@ function WrapContext:unwrap(opt)
vim.fn.setline(self.range.start.row, line)
vim.fn.execute(string.format('%d,%dd_', self.range.start.row + 1, self.range.stop.row))
for _, param in ipairs(self.params.parsed) do
if param:is_active() then
cursor.row = Cursor:get_current().row - 1
end
end
if cursor then
cursor:set_current()
end