File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -194,16 +194,19 @@ void Simplifier::PushBack(const an<Candidate>& original,
194194 CandidateQueue* result, const string& simplified) {
195195 string tips;
196196 string text;
197+ size_t length = utf8::unchecked::distance (original->text ().c_str (),
198+ original->text ().c_str ()
199+ + original->text ().length ());
200+ bool show_tips = (tips_level_ == kTipsChar && length == 1 ) || tips_level_ == kTipsAll ;
197201 if (show_in_comment_) {
198202 text = original->text ();
199- tips = simplified;
200- comment_formatter_.Apply (&tips);
203+ if (show_tips) {
204+ tips = simplified;
205+ comment_formatter_.Apply (&tips);
206+ }
201207 } else {
202- size_t length = utf8::unchecked::distance (original->text ().c_str (),
203- original->text ().c_str ()
204- + original->text ().length ());
205208 text = simplified;
206- if ((tips_level_ == kTipsChar && length == 1 ) || tips_level_ == kTipsAll ) {
209+ if (show_tips ) {
207210 tips = original->text ();
208211 bool modified = comment_formatter_.Apply (&tips);
209212 if (!modified) {
You can’t perform that action at this time.
0 commit comments