diff options
author | Tom Feist <shabble@metavore.org> | 2010-12-11 03:48:14 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-12-11 03:48:14 +0000 |
commit | da1d6d1e492075f38897574d46233d39f0fccb4c (patch) | |
tree | 9c7ad4515ddc88f8ac81d8484a7e0b80fac9eda0 | |
parent | ido_switch: flex_match is now case-insensitive (diff) | |
download | irssi-scripts-da1d6d1e492075f38897574d46233d39f0fccb4c.tar.gz irssi-scripts-da1d6d1e492075f38897574d46233d39f0fccb4c.zip |
ido_switch: support for numerical selection of windows
-rw-r--r-- | ido-mode/ido_switcher.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ido-mode/ido_switcher.pl b/ido-mode/ido_switcher.pl index 99f8260..de7bbd9 100644 --- a/ido-mode/ido_switcher.pl +++ b/ido-mode/ido_switcher.pl @@ -292,7 +292,10 @@ sub update_prompt { } sub update_matches { - if ($ido_use_flex) { + + if ($search_str =~ m/^\d+$/) { + @search_matches = grep { $_->{num} == 0+$search_str } @window_cache; + } elsif ($ido_use_flex) { @search_matches = grep { flex_match($search_str, $_->{name}) } @window_cache; } else { @search_matches = grep { $_->{name} =~ m/\Q$search_str\E/i } @window_cache; |