From 42ed0ffad9851f3794a9dff080a2789c87c6d7c8 Mon Sep 17 00:00:00 2001 From: glepnir Date: Sat, 31 Aug 2024 02:23:49 +0800 Subject: fix(lsp): when prefix is non word add all result into matches (#30044) Problem: prefix can be a symbol like period, the fuzzy matching can't handle it correctly. Solution: when prefix is empty or a symbol add all lsp completion result into matches. --- runtime/lua/vim/lsp/completion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index e28fec5e25..89d6d0e8b9 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -238,7 +238,7 @@ function M._lsp_to_complete_items(result, prefix, client_id) ---@type fun(item: lsp.CompletionItem):boolean local matches - if prefix == '' then + if not prefix:find('%w') then matches = function(_) return true end -- cgit