1

Revert "Cleanup"

This reverts commit 2a35d6ab9d.
This commit is contained in:
Alex Yatskov 2024-04-26 23:12:38 -07:00
parent 2a35d6ab9d
commit cfafbb7e14

View File

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