From f7292a69f1dc3d938cc47213dc03deb25cf84b68 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sun, 26 Sep 2010 16:48:17 +0100 Subject: changed history version-check to emulate an up/down arrow keypress on older versions of irssi. --- vim-mode/vim_mode.pl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index ed79f61..621cc4b 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -228,11 +228,17 @@ sub cmd_movement_l { $pos = $length if $pos > $length; _input_pos($pos); } + # later history (down) sub cmd_movement_j { my ($count, $pos) = @_; - return unless Irssi::version > 20090117; + if (Irssi::version < 20090117) { + # simulate a down-arrow + _emulate_keystrokes(0x1b, 0x5b, 0x42); + return; + } + my @history = Irssi::active_win->get_history_lines(); if (defined $history_index) { @@ -255,7 +261,12 @@ sub cmd_movement_j { sub cmd_movement_k { my ($count, $pos) = @_; - return unless Irssi::version > 20090117; + if (Irssi::version < 20090117) { + # simulate an up-arrow + _emulate_keystrokes(0x1b, 0x5b, 0x41); + return; + } + my @history = Irssi::active_win->get_history_lines(); if (defined $history_index) { -- cgit v1.2.3