mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
Merge pull request #14698 from jose-elias-alvarez/omnifunc-insert-check
fix(lsp): check mode in omnifunc callback
This commit is contained in:
@@ -1421,7 +1421,7 @@ function lsp.omnifunc(findstart, base)
|
||||
|
||||
local items = {}
|
||||
lsp.buf_request(bufnr, 'textDocument/completion', params, function(err, _, result)
|
||||
if err or not result then return end
|
||||
if err or not result or vim.fn.mode() ~= "i" then return end
|
||||
local matches = util.text_document_completion_list_to_complete_items(result, prefix)
|
||||
-- TODO(ashkan): is this the best way to do this?
|
||||
vim.list_extend(items, matches)
|
||||
|
Reference in New Issue
Block a user