File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -194,16 +194,19 @@ void Simplifier::PushBack(const an<Candidate>& original,
194
194
CandidateQueue* result, const string& simplified) {
195
195
string tips;
196
196
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 ;
197
201
if (show_in_comment_) {
198
202
text = original->text ();
199
- tips = simplified;
200
- comment_formatter_.Apply (&tips);
203
+ if (show_tips) {
204
+ tips = simplified;
205
+ comment_formatter_.Apply (&tips);
206
+ }
201
207
} else {
202
- size_t length = utf8::unchecked::distance (original->text ().c_str (),
203
- original->text ().c_str ()
204
- + original->text ().length ());
205
208
text = simplified;
206
- if ((tips_level_ == kTipsChar && length == 1 ) || tips_level_ == kTipsAll ) {
209
+ if (show_tips ) {
207
210
tips = original->text ();
208
211
bool modified = comment_formatter_.Apply (&tips);
209
212
if (!modified) {
You can’t perform that action at this time.
0 commit comments