From da1d6d1e492075f38897574d46233d39f0fccb4c Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sat, 11 Dec 2010 03:48:14 +0000 Subject: ido_switch: support for numerical selection of windows --- ido-mode/ido_switcher.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ido-mode') 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; -- cgit v1.2.3