commit 2d50c9f34ebd77a1599fbd97e326359d4d2a6465
parent 296f9affbca4919d779050a45b261f67237957e9
Author: Markus Klinik <mkl@lambdanaut.net>
Date: Tue, 8 Apr 2014 17:47:42 +0200
completion-mode: correctly set completion character
Auto completion is case-insensitive. Calculation of the completion
character must be case-insensitive as well.
Otherwise, if you have two labels "bar" and "Baz", and you type
Lba
the letters 'b' and 'B' are marked, when really 'r' and 'z' should be
marked. The same goes for contacts with an initial segment that differs
only in case.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
@@ -547,7 +547,7 @@ EOS
kill_buffer completion_buf if completion_buf
shorts = tf.completions.map { |full, short| short }
- prefix_len = shorts.shared_prefix.length
+ prefix_len = shorts.shared_prefix(caseless=true).length
mode = CompletionMode.new shorts, :header => "Possible completions for \"#{tf.value}\": ", :prefix_len => prefix_len
completion_buf = spawn "<completions>", mode, :height => 10