aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorruniq <patrice.peterson@mailbox.org>2021-02-04 12:35:17 +0100
committerGitHub <noreply@github.com>2021-02-04 12:35:17 +0100
commit94cf7bba008ff0c36828565a408b7ef79203e069 (patch)
treed7fb3275b7d5ec67183a90ffa770250faa5101c6 /runtime/lua/vim/lsp/util.lua
parentb96db38af184b1a271c88a4c89e709ce32143514 (diff)
downloadrneovim-94cf7bba008ff0c36828565a408b7ef79203e069.tar.gz
rneovim-94cf7bba008ff0c36828565a408b7ef79203e069.tar.bz2
rneovim-94cf7bba008ff0c36828565a408b7ef79203e069.zip
lsp: Fix pumvisible() check introduced in #12900 (#13866)
`pumvisible()` returns a number, and numbers are always `true` in Lua, so the return value needs to be checked explicitly. Using https://github.com/neovim/neovim/pull/12900 as context, it appears the intention was to move into the `if` branch when the completion popup is not shown (i.e. `vim.fn.pumvisible() == 0`).
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index e33e0109b6..00bdeecef3 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -726,7 +726,7 @@ function M.focusable_float(unique_name, fn)
local bufnr = api.nvim_get_current_buf()
do
local win = find_window_by_var(unique_name, bufnr)
- if win and api.nvim_win_is_valid(win) and not vim.fn.pumvisible() then
+ if win and api.nvim_win_is_valid(win) and vim.fn.pumvisible() == 0 then
api.nvim_set_current_win(win)
api.nvim_command("stopinsert")
return