From c04c2f7114d9181ea34c73870298b32e8792b565 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sun, 26 Sep 2010 16:40:48 +0100 Subject: added version test to history motion to avoid erroring on older versions that don't have history_get_lines() --- vim-mode/vim_mode.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vim-mode/vim_mode.pl') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 27210f6..ed79f61 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -3,7 +3,8 @@ # Currently supported features: # # * Insert/Command mode. Escape enters command mode. -# * cursor motion with: h, l, j, k +# * cursor motion with: h, l +# * history motion with j,k (only supported on Irssi versions > 0.8.13) # * cursor word motion with: w, b, e # * delete at cursor: x # * Insert mode at pos: i, a @@ -231,6 +232,7 @@ sub cmd_movement_l { sub cmd_movement_j { my ($count, $pos) = @_; + return unless Irssi::version > 20090117; my @history = Irssi::active_win->get_history_lines(); if (defined $history_index) { @@ -253,6 +255,7 @@ sub cmd_movement_j { sub cmd_movement_k { my ($count, $pos) = @_; + return unless Irssi::version > 20090117; my @history = Irssi::active_win->get_history_lines(); if (defined $history_index) { -- cgit v1.2.3