fix(util): pass offset_encoding to apply_text_edits

Offset encoding is a mandatory argument to
`vim.lsp.util.apply_text_edits` since bc722c8a74

Since we are always within a Neovim context, we can just pass `"utf-8"`.
This commit is contained in:
Christian Clason 2022-01-14 21:06:56 +01:00 committed by Stephan Seitz
parent 749f72d351
commit ca837f5218

View file

@ -331,7 +331,7 @@ function M.swap_nodes(node_or_range1, node_or_range2, bufnr, cursor_to_second)
local edit1 = { range = range1, newText = table.concat(text2, "\n") }
local edit2 = { range = range2, newText = table.concat(text1, "\n") }
vim.lsp.util.apply_text_edits({ edit1, edit2 }, bufnr)
vim.lsp.util.apply_text_edits({ edit1, edit2 }, bufnr, "utf-8")
if cursor_to_second then
utils.set_jump()