commit 5fa434fe2d3b9b6c425fc602fb0d89ad8c85f20c
parent 2a76b64f19a08d8ddb912a6004f5a31dfe1a7c5f
Author: Whyme Lyu <callme5long@gmail.com>
Date: Sun, 30 Jun 2013 16:07:13 +0800
Use with slice_by_display_length when composing threadline
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sup/modes/thread_index_mode.rb b/lib/sup/modes/thread_index_mode.rb
@@ -856,14 +856,14 @@ protected
abbrev =
if cur_width + name.display_length > from_width
- name[0 ... (from_width - cur_width - 1)] + "."
+ name.slice_by_display_length(from_width - cur_width - 1) + "."
elsif cur_width + name.display_length == from_width
- name[0 ... (from_width - cur_width)]
+ name.slice_by_display_length(from_width - cur_width)
else
if last
- name[0 ... (from_width - cur_width)]
+ name.slice_by_display_length(from_width - cur_width)
else
- name[0 ... (from_width - cur_width - 1)] + ","
+ name.slice_by_display_length(from_width - cur_width - 1) + ","
end
end