lib/textbringer/commands/misc.rb in textbringer-1.1.1 vs lib/textbringer/commands/misc.rb in textbringer-1.1.2
- old
+ new
@@ -123,10 +123,11 @@
private :complete_minibuffer_with_string
define_command(:complete_minibuffer) do
minibuffer = Buffer.minibuffer
completion_proc = minibuffer[:completion_proc]
+ ignore_case = minibuffer[:completion_ignore_case]
if completion_proc
xs = completion_proc.call(minibuffer.to_s)
update_completions(xs)
if xs.empty?
message("No match", sit_for: 1)
@@ -134,10 +135,14 @@
end
y, *ys = xs
s = y.size.downto(1).lazy.map { |i|
y[0, i]
}.find { |i|
- ys.all? { |j| j.start_with?(i) }
+ i = i.downcase if ignore_case
+ ys.all? { |j|
+ j = j.downcase if ignore_case
+ j.start_with?(i)
+ }
}
if s
complete_minibuffer_with_string(s)
end
end