ruby/command-t/match_window.rb
# Highlight matching characters within the matched string.
#
# Note that this is only approximate; it will highlight the first matching
# instances within the string, which may not actually be the instances that
# were used by the matching/scoring algorithm to determine the best score
# for the match.
#
Highlight matching characters within the matched string.
Note that this is only approximate; it will highlight the first matching
instances within the string, which may not actually be the instances that
were used by the matching/scoring algorithm to determine the best score
for the match.
Highlight matching characters within the matched string . Note that this is only approximate ; it will highlight the first matching instances within the string which may not actually be the instances that were used by the matching / scoring algorithm to determine the best score for the match .
def match_with_syntax_highlight match
      highlight_chars = @prompt.abbrev.downcase.chars.to_a
      match.chars.inject([]) do |output, char|
        if char.downcase == highlight_chars.first
          highlight_chars.shift
          output.concat [MH_START, char, MH_END]
        else
          output << char
        end
      end.join
    end
def match_with_syntax_highlight match highlight_chars = @prompt . abbrev . downcase . chars . to_a match . chars . inject ( [ ] ) do | output , char | if char . downcase == highlight_chars . first highlight_chars . shift output . concat [ MH_START , char , MH_END ] else output << char end end . join end
Highlight matching characters within the matched string.
Highlight matching characters within the matched string .
match