Improve a bit

This commit is contained in:
hrsh7th
2022-11-25 03:20:07 +09:00
parent 431f045968
commit 4c05626ccd
2 changed files with 20 additions and 7 deletions

View File

@@ -289,7 +289,7 @@ source.complete = function(self, ctx, callback)
triggerCharacter = before_char,
}
elseif ctx:get_reason() ~= types.cmp.ContextReason.TriggerOnly then
if self:get_keyword_length() <= (ctx.cursor.col - offset) then
if offset < ctx.cursor.col and self:get_keyword_length() <= (ctx.cursor.col - offset) then
if self.incomplete and self.context.cursor.col ~= ctx.cursor.col and self.status ~= source.SourceStatus.FETCHING then
completion_context = {
triggerKind = types.lsp.CompletionTriggerKind.TriggerForIncompleteCompletions,