def draw_line ln, opts={}
regex = /(#{@search_query})/i
case(s = self[ln])
when String
if in_search?
draw_line_from_array ln, matching_text_array(s, regex), opts
else
draw_line_from_string ln, s, opts
end
when Array
if in_search?
array = []
s.each do |color, text|
if text =~ regex
array += matching_text_array text, regex, color
else
array << [color, text]
end
end
draw_line_from_array ln, array, opts
else
draw_line_from_array ln, s, opts
end
else
raise "unknown drawable object: #{s.inspect} in #{self} for line #{ln}"
end
end