Skip to content

fix(window): clear docs popup when menu updates to prevent stale items #1934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lua/blink/cmp/completion/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function completion.setup()
-- setup completion menu
if config.completion.menu.enabled then
local menu = function() return require('blink.cmp.completion.windows.menu') end
local docs = function() return require('blink.cmp.completion.windows.documentation') end

local loading_timer = vim.uv.new_timer()
trigger.show_emitter:on(function(event)
Expand All @@ -76,8 +77,9 @@ function completion.setup()

list.select_emitter:on(function(event)
menu().set_selected_item_idx(event.idx)
require('blink.cmp.completion.windows.documentation').auto_show_item(event.context, event.item)
docs().auto_show_item(event.context, event.item)
end)
list.show_emitter:on(function() docs().close() end)
end

-- setup ghost text
Expand Down