From 9e4f6633d27edb7463ed093046a0216b23fad5af Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Sun, 4 Sep 2022 15:22:11 +0100 Subject: [PATCH] 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 --- lua/ivy/controller.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/ivy/controller.lua b/lua/ivy/controller.lua index be93ef6..0fe3b5c 100644 --- a/lua/ivy/controller.lua +++ b/lua/ivy/controller.lua @@ -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