diff options
Diffstat (limited to 'runtime/lua/vim/lsp/completion.lua')
-rw-r--r-- | runtime/lua/vim/lsp/completion.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index 4b7deabf41..2e6d82b367 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -145,8 +145,8 @@ local function get_completion_word(item) -- label: insert -- -- Typing `i` would remove the candidate because newText starts with `t`. - local text = item.insertText or item.textEdit.newText - return #text < #item.label and text or item.label + local text = parse_snippet(item.insertText or item.textEdit.newText) + return #text < #item.label and vim.fn.matchstr(text, '\\k*') or item.label elseif item.insertText and item.insertText ~= '' then return parse_snippet(item.insertText) else |