lib/sup/buffer.rb in sup-0.14.0 vs lib/sup/buffer.rb in sup-0.14.1
- old
+ new
@@ -447,11 +447,11 @@
end
end
def ask_with_completions domain, question, completions, default=nil
ask domain, question, default do |s|
- s.fix_encoding
+ s.fix_encoding!
completions.select { |x| x =~ /^#{Regexp::escape s}/iu }.map { |x| [x, x] }
end
end
def ask_many_with_completions domain, question, completions, default=nil
@@ -464,23 +464,23 @@
[$1 || "", $2]
else
raise "william screwed up completion: #{partial.inspect}"
end
- prefix.fix_encoding
- target.fix_encoding
+ prefix.fix_encoding!
+ target.fix_encoding!
completions.select { |x| x =~ /^#{Regexp::escape target}/iu }.map { |x| [prefix + x, x] }
end
end
def ask_many_emails_with_completions domain, question, completions, default=nil
ask domain, question, default do |partial|
prefix, target = partial.split_on_commas_with_remainder
target ||= prefix.pop || ""
- target.fix_encoding
+ target.fix_encoding!
prefix = prefix.join(", ") + (prefix.empty? ? "" : ", ")
- prefix.fix_encoding
+ prefix.fix_encoding!
completions.select { |x| x =~ /^#{Regexp::escape target}/iu }.sort_by { |c| [ContactManager.contact_for(c) ? 0 : 1, c] }.map { |x| [prefix + x, x] }
end
end