From b3fe1ddeeedf4bd6c6d4d2722a4a8835841c58e0 Mon Sep 17 00:00:00 2001 From: glepnir Date: Wed, 15 Nov 2023 15:19:56 +0800 Subject: [PATCH] fixup --- lua/epo/init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lua/epo/init.lua b/lua/epo/init.lua index 7cda443..3b00b36 100644 --- a/lua/epo/init.lua +++ b/lua/epo/init.lua @@ -355,12 +355,8 @@ local function completion_handler(_, result, ctx) range = textEdit.insert end local te_startcol = charidx_without_comp(ctx.bufnr, range.start) - if te_startcol ~= start_col then - local offset = start_col - te_startcol - entry.word = textEdit.newText:sub(offset + 1) - else - entry.word = textEdit.newText - end + entry.word = te_startcol ~= start_col and textEdit.newText:sub(start_col - te_startcol + 1) + or textEdit.newText elseif vim.tbl_get(item, 'insertText') then entry.word = item.insertText else