aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2010-11-22 19:25:33 +0000
committerTom Feist <shabble@metavore.org>2010-11-22 19:25:33 +0000
commit62b5a3f37f96de31075e9d603c589b799e12689d (patch)
tree6294d09bfba803266401fc0ead0a5c8779347cbd
parentscrolled_reminder: remove 'SPC goes to end of buffer' message once it has bee... (diff)
downloadirssi-scripts-62b5a3f37f96de31075e9d603c589b799e12689d.tar.gz
irssi-scripts-62b5a3f37f96de31075e9d603c589b799e12689d.zip
vim_mode: fix :snext/prev generating warnings when not connected
-rw-r--r--vim-mode/vim_mode.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 3ed29ae..94d8967 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -1796,6 +1796,9 @@ sub ex_server_next {
my @server_ids = map { $_->{tag} . "\x1d" . $_->{nick} } Irssi::servers;
my $server = Irssi::active_server;
+
+ return unless $server;
+
my $current_id = $server->{tag} . "\x1d" . $server->{nick};
my $next = 0;
my $server_count = scalar @server_ids;
@@ -1820,6 +1823,9 @@ sub ex_server_prev {
my @server_ids = map { $_->{tag} . "\x1d" . $_->{nick} } Irssi::servers;
my $server = Irssi::active_server;
+
+ return unless $server;
+
my $current_id = $server->{tag} . "\x1d" . $server->{nick};
my $prev = 0;
my $server_count = scalar @server_ids;