From 2da7fed0559a6f8249cef1f4ec6f67b65deee49a Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Fri, 31 Dec 2010 00:00:38 +0000 Subject: ido_switch: bugfix: visiting active items removes them from the active list. --- ido-mode/ido_switcher.pl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ido-mode/ido_switcher.pl b/ido-mode/ido_switcher.pl index 0ae5e1f..5d6be5a 100644 --- a/ido-mode/ido_switcher.pl +++ b/ido-mode/ido_switcher.pl @@ -356,17 +356,18 @@ sub get_all_windows { } sub ido_switch_select { - my ($selected, $is_refnum) = @_; + my ($selected) = @_; _debug_print "Selecting window: " . $selected->{name}; Irssi::command("WINDOW GOTO " . $selected->{name}); - if ($selected->{type} ne 'WINDOW') { + if ($selected->{type} ne 'WIN') { _debug_print "Selecting window item: " . $selected->{itemname}; Irssi::command("WINDOW ITEM GOTO " . $selected->{itemname}); } + update_matches(); } sub ido_switch_exit { @@ -398,9 +399,13 @@ sub get_all_windows { my @ordered_matches = _order_matches(@search_matches); - my %uniq; + my @display = @ordered_matches[0..$show_count - 1]; + # determine which items are non-unique, if any. - foreach my $res (@ordered_matches) { + + my %uniq; + + foreach my $res (@display) { my $name = $res->{name}; if (exists $uniq{$name}) { @@ -420,9 +425,6 @@ sub get_all_windows { } } - # - my @display = @ordered_matches[0..$show_count - 1]; - # show the first entry in green my $first = shift @display; -- cgit v1.2.3