From 69c85860d7c3b39e1be3881702e13a8440cd33fc Mon Sep 17 00:00:00 2001 From: stnley <64174376+stnley@users.noreply.github.com> Date: Fri, 11 Nov 2022 07:44:36 -0500 Subject: [PATCH] chore: run formatting (#1295) Co-authored-by: stnley --- lua/cmp/core.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/cmp/core.lua b/lua/cmp/core.lua index 3a3e942..4d1298a 100644 --- a/lua/cmp/core.lua +++ b/lua/cmp/core.lua @@ -125,7 +125,7 @@ core.on_keymap = function(self, keys, fallback) }, function() local ctx = self:get_context() local word = e:get_word() - if string.sub(ctx.cursor_before_line, - #word, ctx.cursor.col - 1) == word and is_printable then + if string.sub(ctx.cursor_before_line, -#word, ctx.cursor.col - 1) == word and is_printable then fallback() else self:reset() @@ -417,8 +417,7 @@ core.confirm = function(self, e, option, callback) local completion_item = misc.copy(e:get_completion_item()) if not misc.safe(completion_item.textEdit) then completion_item.textEdit = {} - completion_item.textEdit.newText = misc.safe(completion_item.insertText) or completion_item.word or - completion_item.label + completion_item.textEdit.newText = misc.safe(completion_item.insertText) or completion_item.word or completion_item.label end local behavior = option.behavior or config.get().confirmation.default_behavior if behavior == types.cmp.ConfirmBehavior.Replace then