Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 4f7baaa

Browse files
a8568730sih4sing5hong5
a8568730
authored andcommitted
fix(script_translator): always_show_comments also applies to phrases
Closes rime#272, Closes rime#419
1 parent 10a309e commit 4f7baaa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/rime/gear/script_translator.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@ an<Candidate> ScriptTranslation::Peek() {
472472
if (candidate_->comment().empty() && (translator_->sutsoo_lomaji() || candidate_->type() != "sentence")) {
473473
auto spelling = syllabifier_->GetOriginalSpelling(*candidate_);
474474
bool sichoanlosu = SiChoanLoSu(candidate_->text(), spelling);
475-
if (!spelling.empty() && !sichoanlosu) {
475+
if (!spelling.empty() && !sichoanlosu &&
476+
(translator_->always_show_comments() ||
477+
spelling != candidate_->preedit())) {
476478
candidate_->set_comment(/*quote_left + */spelling/* + quote_right*/);
477479
}
478480
}
@@ -486,9 +488,6 @@ void ScriptTranslation::PrepareCandidate() {
486488
return;
487489
}
488490
if (sentence_) {
489-
if (sentence_->preedit().empty()) {
490-
sentence_->set_preedit(syllabifier_->GetPreeditString(*sentence_));
491-
}
492491
candidate_ = sentence_;
493492
return;
494493
}

0 commit comments

Comments
 (0)