diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-11-23 00:22:37 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-11-23 00:22:37 +0000 |
| commit | 03dcfb25744f35378a479c12077f96487a4eb101 (patch) | |
| tree | 61788e8845588d963df2623ddfafe6382eb415b8 /src | |
| parent | ca0606017f4f3b975f6c696b6f103162e773feed (diff) | |
Small code tweak
Diffstat (limited to 'src')
| -rw-r--r-- | src/string.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/string.cc b/src/string.cc index e4d4ba96..5a229030 100644 --- a/src/string.cc +++ b/src/string.cc @@ -423,10 +423,11 @@ Vector<StringView> wrap_lines(StringView text, ColumnCount max_width) ++word_end; while (word_end > line_begin and - StringView{line_begin.base(), word_end.base()}.column_length() >= max_width) + utf8::column_distance(line_begin.base(), word_end.base()) >= max_width) { - auto line_end = last_word_end <= line_begin ? Utf8It{utf8::advance(line_begin.base(), text.end(), max_width), text} - : last_word_end; + auto line_end = last_word_end <= line_begin ? + Utf8It{utf8::advance(line_begin.base(), text.end(), max_width), text} + : last_word_end; lines.emplace_back(line_begin.base(), line_end.base()); |
