fix: 修复空码回溯功能

This commit is contained in:
amzxyz
2026-01-30 21:11:40 +08:00
parent 937e7bbf61
commit d971547cf9
2 changed files with 5 additions and 5 deletions

View File

@@ -7250,7 +7250,7 @@ bittorrent bittorrent
bitty bitty bitty bitty
bitumen bitumen bitumen bitumen
bituminous bituminous bituminous bituminous
bitwarden bitwarden Bitwarden Bitwarden
bitwise bitwise bitwise bitwise
bivalent bivalent bivalent bivalent
bivalve bivalve bivalve bivalve
@@ -26962,7 +26962,7 @@ gels gels
gem gem gem gem
gemara gemara gemara gemara
geminate geminate geminate geminate
Gemini Gemini gemini gemini
Geminid Geminid Geminid Geminid
Gemma Gemma Gemma Gemma
gemmiparous gemmiparous gemmiparous gemmiparous

View File

@@ -368,7 +368,7 @@ function F.func(input, env)
local good_cand = restore_sentence_spacing(cand, env.split_pattern, env.delim_check_pattern) local good_cand = restore_sentence_spacing(cand, env.split_pattern, env.delim_check_pattern)
local fmt_cand = apply_formatting(good_cand, code_ctx) local fmt_cand = apply_formatting(good_cand, code_ctx)
-- [恢复] 去除注释中的太极符号 -- 去除注释中的太极符号
if fmt_cand.comment and find(fmt_cand.comment, "\226\152\175") then if fmt_cand.comment and find(fmt_cand.comment, "\226\152\175") then
local nc = Candidate(fmt_cand.type, fmt_cand.start, fmt_cand._end, fmt_cand.text, "") local nc = Candidate(fmt_cand.type, fmt_cand.start, fmt_cand._end, fmt_cand.text, "")
nc.preedit = fmt_cand.preedit nc.preedit = fmt_cand.preedit
@@ -400,7 +400,7 @@ function F.func(input, env)
if not best_candidate_saved and cand.comment ~= "~" and not env.block_derivation then if not best_candidate_saved and cand.comment ~= "~" and not env.block_derivation then
env.memory[curr_input] = { env.memory[curr_input] = {
text = fmt_cand.text, text = fmt_cand.text,
preedit = fmt_cand.preedit or curr_input preedit = curr_input
} }
best_candidate_saved = true best_candidate_saved = true
end end
@@ -421,7 +421,7 @@ function F.func(input, env)
if not best_candidate_saved and cand.comment ~= "~" and not env.block_derivation then if not best_candidate_saved and cand.comment ~= "~" and not env.block_derivation then
env.memory[curr_input] = { env.memory[curr_input] = {
text = fmt_cand.text, text = fmt_cand.text,
preedit = fmt_cand.preedit or curr_input preedit = curr_input
} }
best_candidate_saved = true best_candidate_saved = true
end end