end
if line
@search_line = line + 1
- search_goto_pos line, col, col + @search_query.length
+ search_goto_pos line, col, col + @search_query.display_length
buffer.mark_dirty
else
BufferManager.flash "Not found!"
if match
return [i, offset + match]
else
- offset += string.length
+ offset += string.display_length
end
end
end
a.each do |color, text|
raise "nil text for color '#{color}'" if text.nil? # good for debugging
- if xpos + text.length < @leftcol
+ if xpos + text.display_length < @leftcol
buffer.write ln - @topline, 0, "", :color => color,
:highlight => opts[:highlight]
- xpos += text.length
+ xpos += text.display_length
elsif xpos < @leftcol
## partial
buffer.write ln - @topline, 0, text[(@leftcol - xpos) .. -1],
:color => color,
:highlight => opts[:highlight]
- xpos += text.length
+ xpos += text.display_length
else
buffer.write ln - @topline, xpos - @leftcol, text,
:color => color, :highlight => opts[:highlight]
- xpos += text.length
+ xpos += text.display_length
end
end
end
## let's see you do THIS in python
@threads = @ts.threads.select { |t| !@hidden_threads[t] }.sort_by { |t| [t.date, t.first.id] }.reverse
@size_widgets = @threads.map { |t| size_widget_for_thread t }
- @size_widget_width = @size_widgets.max_of { |w| w.length }
+ @size_widget_width = @size_widgets.max_of { |w| w.display_length }
end
regen_text
last = i == ann.length - 1
abbrev =
- if cur_width + name.length > from_width
+ if cur_width + name.display_length > from_width
name[0 ... (from_width - cur_width - 1)] + "."
- elsif cur_width + name.length == from_width
+ elsif cur_width + name.display_length == from_width
name[0 ... (from_width - cur_width)]
else
if last
end
end
- cur_width += abbrev.length
+ cur_width += abbrev.display_length
if last && from_width > cur_width
abbrev += " " * (from_width - cur_width)