Skip to content

Commit

Permalink
enhance(lua): pin造詞時對中文候選取 genuine candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeiwu authored Feb 5, 2025
1 parent 2e97bdc commit 959d07d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/moran_pin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 959d07d

Please # to comment.