mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +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 = {}
|
local items = {}
|
||||||
lsp.buf_request(bufnr, 'textDocument/completion', params, function(err, _, result)
|
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)
|
local matches = util.text_document_completion_list_to_complete_items(result, prefix)
|
||||||
-- TODO(ashkan): is this the best way to do this?
|
-- TODO(ashkan): is this the best way to do this?
|
||||||
vim.list_extend(items, matches)
|
vim.list_extend(items, matches)
|
||||||
|
Reference in New Issue
Block a user