diff options
| author | Tom Feist <shabble@metavore.org> | 2010-12-11 03:20:46 +0000 | 
|---|---|---|
| committer | Tom Feist <shabble@metavore.org> | 2010-12-11 03:20:46 +0000 | 
| commit | f7c824c50425b2ea998215eae3e1b3cc5d0e74b4 (patch) | |
| tree | 6b1067e71ed6c49517e1999c0b9e351a38351c49 | |
| parent | tab displays full list in window, select/cancel clears it. (diff) | |
| download | irssi-scripts-f7c824c50425b2ea998215eae3e1b3cc5d0e74b4.tar.gz irssi-scripts-f7c824c50425b2ea998215eae3e1b3cc5d0e74b4.zip | |
ido_switch: flex_match is now case-insensitive
| -rw-r--r-- | ido-mode/ido_switcher.pl | 9 | 
1 files changed, 6 insertions, 3 deletions
| diff --git a/ido-mode/ido_switcher.pl b/ido-mode/ido_switcher.pl index 5e22046..99f8260 100644 --- a/ido-mode/ido_switcher.pl +++ b/ido-mode/ido_switcher.pl @@ -295,7 +295,7 @@ sub update_matches {      if ($ido_use_flex) {          @search_matches = grep { flex_match($search_str, $_->{name}) } @window_cache;      } else { -        @search_matches = grep { $_->{name} =~ m/\Q$search_str\E/    } @window_cache; +        @search_matches = grep { $_->{name} =~ m/\Q$search_str\E/i   } @window_cache;      }  } @@ -303,11 +303,14 @@ sub update_matches {  sub flex_match {      my ($pattern, $source) = @_; -    my @chars = split '', $pattern; +    my @chars = split '', lc($pattern);      my $i = -1;      my $ret = 1; + +    my $lc_source = lc($source); +      foreach my $char (@chars) { -        my $pos = index($source, $char, $i); +        my $pos = index($lc_source, $char, $i);          if ($pos > -1) {              $i = $pos;          } else { | 
