lsp: fix failed switch window error (#12900)

* fix failed switch window error

* checks if  window already exists
This commit is contained in:
Raphael 2020-09-14 23:03:02 +08:00 committed by GitHub
parent 4a2618c817
commit f34eeba2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -668,7 +668,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 then
if win and api.nvim_win_is_valid(win) and not vim.fn.pumvisible() then
api.nvim_set_current_win(win)
api.nvim_command("stopinsert")
return