diff options
author | glepnir <glephunter@gmail.com> | 2024-08-22 15:51:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-22 09:51:44 +0200 |
commit | e48179f31e6503bfa86bf08538e64456e96446a8 (patch) | |
tree | 96dcd2d563ffd929e74783b1308998addcc63d5f /runtime/lua/vim/lsp/completion.lua | |
parent | 3bd7492a69a0bf00b366a46dc09d5035b9f784e4 (diff) | |
download | rneovim-e48179f31e6503bfa86bf08538e64456e96446a8.tar.gz rneovim-e48179f31e6503bfa86bf08538e64456e96446a8.tar.bz2 rneovim-e48179f31e6503bfa86bf08538e64456e96446a8.zip |
fix(lsp): suppress completion request if completion is active (#30028)
Problem: the autotrigger mechanism could fire completion requests despite
completion already being active from another completion mechanism or manual
trigger
Solution: add a condition to avoid an additional request.
Diffstat (limited to 'runtime/lua/vim/lsp/completion.lua')
-rw-r--r-- | runtime/lua/vim/lsp/completion.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index 6a6659fd25..022edf5fab 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -403,6 +403,10 @@ local function trigger(bufnr, clients) reset_timer() Context:cancel_pending() + if tonumber(vim.fn.pumvisible()) == 1 and Context.isIncomplete then + return + end + local win = api.nvim_get_current_win() local cursor_row, cursor_col = unpack(api.nvim_win_get_cursor(win)) --- @type integer, integer local line = api.nvim_get_current_line() |