From 959d07d5bfe340248c5aade4a7dfea86ad899cfe Mon Sep 17 00:00:00 2001 From: pfeiwu Date: Wed, 5 Feb 2025 13:16:12 +0800 Subject: [PATCH] =?UTF-8?q?enhance(lua):=20pin=E9=80=A0=E8=A9=9E=E6=99=82?= =?UTF-8?q?=E5=B0=8D=E4=B8=AD=E6=96=87=E5=80=99=E9=81=B8=E5=8F=96=20genuin?= =?UTF-8?q?e=20candidate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/moran_pin.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/moran_pin.lua b/lua/moran_pin.lua index 3da8e73..1aeadfe 100644 --- a/lua/moran_pin.lua +++ b/lua/moran_pin.lua @@ -382,7 +382,11 @@ function panacea_translator.init(env) local commit_text = ctx:get_commit_text() local selected_cand = ctx:get_selected_candidate() if selected_cand ~= nil then - if env.freestyle and selected_cand:get_genuine().type == "pin_tip" then + local gen_cand = selected_cand:get_genuine() + if moran.str_is_chinese(selected_cand.text) then + commit_text = gen_cand.text + end + if env.freestyle and gen_cand.type == "pin_tip" then if env.freestyle_state then if env.freestyle_code and env.freestyle_code ~= "" and env.freestyle_text and env.freestyle_text ~= "" then user_db.toggle_pin_status(env.freestyle_code, env.freestyle_text)