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 683ce58652
commit 9e4f6633d2

View file

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