Skip to content

Commit

Permalink
Properly close win
Browse files Browse the repository at this point in the history
  • Loading branch information
deathbeam committed Oct 16, 2024
1 parent 41bcaae commit 9212194
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lua/autocomplete/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ end

local function changed_handler()
if not is_cmdline() then
close_win()
return
end

Expand All @@ -227,6 +228,7 @@ end

local function enter_handler()
if not is_cmdline() then
close_win()
return
end

Expand All @@ -239,11 +241,7 @@ local function leave_handler()
util.stop(state.entry)
state.completion.data = {}
state.completion.last = nil

if state.window.id and vim.api.nvim_win_is_valid(state.window.id) then
vim.api.nvim_win_close(state.window.id, true)
state.window.id = nil
end
close_win()
end

M.config = {
Expand Down

0 comments on commit 9212194

Please sign in to comment.