From: Girish Palya Date: Thu, 1 Jun 2023 14:13:57 +0000 (+0200) Subject: Fix bug where buffer completion spams X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=7b8ee51147a3ba3b8a6b542a9b599e7b6f311b7d;p=vim-lsp.git Fix bug where buffer completion spams Steps to reproduce: - Enable buffer completion - Search for 'xyz' where 'xy' has completions - Backspace to remove 'z' - You'll see all items from current buffer shown that are not related to 'xy' M autoload/lsp/completion.vim --- diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index fffc3e6..1b8e53c 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -228,8 +228,9 @@ export def CompletionReply(lspserver: dict, cItems: any) # snippet completion. Needs a snippet plugin to expand the snippet. # Remove all the snippet placeholders d.word = MakeValidWord(d.word) - elseif !lspserver.completeItemsIsIncomplete - # Don't attempt to filter on the items, when "isIncomplete" is set + elseif !lspserver.completeItemsIsIncomplete || opt.lspOptions.useBufferCompletion + # Filter items only when "isIncomplete" is set (otherwise server would + # have done the filtering) or when buffer completion is enabled # plain text completion if prefix != ''