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

Commit

Permalink
fix(script_translator): always_show_comments also applies to phrases
Browse files Browse the repository at this point in the history
Closes rime#272, Closes rime#419
  • Loading branch information
a8568730 authored and sih4sing5hong5 committed Jan 3, 2022
1 parent 10a309e commit 4f7baaa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/rime/gear/script_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ an<Candidate> ScriptTranslation::Peek() {
if (candidate_->comment().empty() && (translator_->sutsoo_lomaji() || candidate_->type() != "sentence")) {
auto spelling = syllabifier_->GetOriginalSpelling(*candidate_);
bool sichoanlosu = SiChoanLoSu(candidate_->text(), spelling);
if (!spelling.empty() && !sichoanlosu) {
if (!spelling.empty() && !sichoanlosu &&
(translator_->always_show_comments() ||
spelling != candidate_->preedit())) {
candidate_->set_comment(/*quote_left + */spelling/* + quote_right*/);
}
}
Expand All @@ -486,9 +488,6 @@ void ScriptTranslation::PrepareCandidate() {
return;
}
if (sentence_) {
if (sentence_->preedit().empty()) {
sentence_->set_preedit(syllabifier_->GetPreeditString(*sentence_));
}
candidate_ = sentence_;
return;
}
Expand Down

0 comments on commit 4f7baaa

Please sign in to comment.