From 6e6f7fd6a75d66363e7b61454335db37204e98d2 Mon Sep 17 00:00:00 2001 From: glepnir Date: Wed, 29 Nov 2023 18:40:36 +0800 Subject: [PATCH] update --- lua/epo/init.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lua/epo/init.lua b/lua/epo/init.lua index f8576f2..307c640 100644 --- a/lua/epo/init.lua +++ b/lua/epo/init.lua @@ -242,6 +242,10 @@ local function complete_ondone(bufnr) offset_snip = cp_item.insertText end + if cp_item.additionalTextEdits then + lsp.util.apply_text_edits(cp_item.additionalTextEdits, bufnr, client.offset_encoding) + end + if offset_snip then offset_snip = offset_snip:sub(col - context[args.buf].startidx + 1) if #offset_snip > 0 then @@ -249,16 +253,6 @@ local function complete_ondone(bufnr) end end - if cp_item.additionalTextEdits then - for _, edit in ipairs(cp_item.additionalTextEdits) do - local range = edit.range - if range.start.line == range['end'].line then - range['end'].line = range['end'].line + 1 - end - end - lsp.util.apply_text_edits(cp_item.additionalTextEdits, bufnr, client.offset_encoding) - end - if signature then local clients = vim.lsp.get_clients({ bufnr = args.buf, method = ms.textDocument_signatureHelp })