wincent/Command-T — pull request #58 by shuizhou (2013-12-03 14:36:49+00:00)
Title: This patch fixed two 'compatibility' issues of command-t related to Ruby

1.8.5 on my CentOS 5.4 box.

Vim 7.4 issues some error messages on CentOS 5.4:

1. NoMethodError: undefined method `each_char' for "":String

2. NoMethodError: undefined method `[]' for nil:NilClas

It turns out that there is no String.chars method in Ruby version 1.8.5.

$ ruby --version ruby 1.8.5 (2006-08-25) [x86_64-linux]

In lieu of 'chars' method used in 'ruby/command-t/match_window.rb', I use
'each_char.to_a' method.

I also hard coded the numbers in function 'register_for_key_presses' from

numbers = ('0'..'9').to_a.join
to
numbers = ('0'..'9').to_a.join # not as smart but always work

The reason is that the range syntax doesn't work ('0'..'9') in my box, which
caused the second error message. It could be more of a ruby issue specific to
my box or has to do with my configuration than a bug or incompatibility issue
with CommandT. But the change still justifies for it will work in viturally on
all ruby versions in all situtaions.