diff options
author | glepnir <glephunter@gmail.com> | 2024-08-31 02:23:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-30 20:23:49 +0200 |
commit | 42ed0ffad9851f3794a9dff080a2789c87c6d7c8 (patch) | |
tree | b6475df03f863ce9179a614158d437d56f31813f /runtime/lua/vim/lsp/completion.lua | |
parent | 5f95f1249f464e4f0ceed468ec5a1ba6e810da14 (diff) | |
download | rneovim-42ed0ffad9851f3794a9dff080a2789c87c6d7c8.tar.gz rneovim-42ed0ffad9851f3794a9dff080a2789c87c6d7c8.tar.bz2 rneovim-42ed0ffad9851f3794a9dff080a2789c87c6d7c8.zip |
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.
Diffstat (limited to 'runtime/lua/vim/lsp/completion.lua')
-rw-r--r-- | runtime/lua/vim/lsp/completion.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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 |