diff options
| author | Simon Ruderich <simon@ruderich.org> | 2010-09-28 01:27:13 +0000 | 
|---|---|---|
| committer | Simon Ruderich <simon@ruderich.org> | 2010-09-28 01:28:54 +0000 | 
| commit | a18dc0ebc72e2aba67506cdb5b57db3f7f5d50c0 (patch) | |
| tree | 30c85e9d181170b74823e71e1aa6ea73406885a6 /vim-mode | |
| parent | vim_mode: :b Ignore case. (diff) | |
| download | irssi-scripts-a18dc0ebc72e2aba67506cdb5b57db3f7f5d50c0.tar.gz irssi-scripts-a18dc0ebc72e2aba67506cdb5b57db3f7f5d50c0.zip  | |
vim_mode: Add support for :b s/c
Where s is the server (lowercase) and c is the channel (lowercase).
Diffstat (limited to 'vim-mode')
| -rw-r--r-- | vim-mode/vim_mode.pl | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index f61ce95..e5cf904 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -726,6 +726,15 @@ sub cmd_ex_command {              Irssi::command('window last');          # Go to best regex matching window.          } else { +            my $server; + +            if ($buffer =~ m{^(.+)/(.+)}) { +                $server = $1; +                $buffer = $2; +            } + +            print ":b searching for channel $buffer" if DEBUG; +            print ":b on server $server" if $server and DEBUG;              my @matches;              foreach my $window (Irssi::windows()) { @@ -739,6 +748,11 @@ sub cmd_ex_command {                  }                  # Matching Window item names (= channels).                  foreach my $item ($window->items()) { +                    # Wrong server. +                    if ($server and (!$item->{server} or +                                     $item->{server}->{chatnet} !~ /^$server/i)) { +                        next; +                    }                      if ($item->{name} =~ /$buffer/i) {                          my $length = length($item->{name});                          $length-- if index($item->{name}, '#') == 0;  | 
