diff options
author | Tom Feist <shabble@metavore.org> | 2010-09-26 15:48:17 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-09-26 15:48:17 +0000 |
commit | f7292a69f1dc3d938cc47213dc03deb25cf84b68 (patch) | |
tree | 7df24155fa48038cc8dd37403315976d776eb437 /vim-mode | |
parent | added version test to history motion to avoid erroring on older versions that (diff) | |
download | irssi-scripts-f7292a69f1dc3d938cc47213dc03deb25cf84b68.tar.gz irssi-scripts-f7292a69f1dc3d938cc47213dc03deb25cf84b68.zip |
changed history version-check to emulate an up/down arrow keypress on older
versions of irssi.
Diffstat (limited to 'vim-mode')
-rw-r--r-- | vim-mode/vim_mode.pl | 15 |
1 files 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) { |