From f11cee0b5d066aefa8281a9890540bd57f191e74 Mon Sep 17 00:00:00 2001 From: JuanZoran <1430359574@qq.com> Date: Wed, 29 Mar 2023 09:19:14 +0800 Subject: [PATCH] fix: fix toggle entry mistake --- lua/Trans/frontend/hover/init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/Trans/frontend/hover/init.lua b/lua/Trans/frontend/hover/init.lua index f7f0e0e..6521eb2 100644 --- a/lua/Trans/frontend/hover/init.lua +++ b/lua/Trans/frontend/hover/init.lua @@ -133,9 +133,10 @@ function M:wait() width = opts.width, } - local cur = 0 - local pr = util.node.prompt - local it = util.node.item + self.waitting = true + local cur = 0 + local pr = util.node.prompt + local it = util.node.item return function(backend) cur = cur + 1 buffer[1] = pr(backend.name_zh) @@ -189,7 +190,7 @@ end ---@param data TransData ---@overload fun(result:TransResult) function M:process(data) - if self.window and self.window:is_valid() then + if not self.waitting and self.window and self.window:is_valid() then self:execute 'toggle_entry' return end