fix: ensure the correct window is activated on complete

When you complete a completion the completion window is no longer
activated after the callback is run. This was causing issues with the
incorrect window being active after the completion.

This will lead the way for more actions other then edit, that will be
comming soon.

Fixes-issue: #8
This commit is contained in:
Ade Attwood 2022-09-04 15:22:11 +01:00
parent a3cd30d4ff
commit 95be579cef

View file

@ -37,7 +37,9 @@ controller.update = function(text)
end end
controller.complete = function() controller.complete = function()
controller.checkpoint() vim.api.nvim_set_current_win(window.origin)
controller.callback(window.get_current_selection())
controller.destroy() controller.destroy()
end end