From 43addba4cdcb540b21a743274cbf6317f6bcdad8 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Mon, 22 Nov 2010 19:29:59 +0000 Subject: vim_mode: mapped Irssi commands only use $server context if it is available. TODO: should maybe also try to use window context if available? --- vim-mode/vim_mode.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'vim-mode') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 94d8967..bad556e 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -2532,7 +2532,15 @@ sub handle_command_cmd { # As can irssi commands. } elsif ($cmd->{type} == C_IRSSI) { print "Processing irssi-command: $map->{char} ($cmd->{char})" if DEBUG; - Irssi::active_server->command($cmd->{func}); + + # TODO: fix me more better (general server/win/none context?) + my $server = Irssi::active_server; + if (defined $server) { + $server->command($cmd->{func}); + } else { + Irssi::command($cmd->{func}); + } + $numeric_prefix = undef; return 1; # call _stop(); # does nothing. -- cgit v1.2.3