aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorTom Feist <shabble@cowu.be>2010-09-26 00:57:41 +0000
committerTom Feist <shabble@cowu.be>2010-09-26 00:57:41 +0000
commite4d18a03b2f94a561b7ea81248cd8ccdc8ed8481 (patch)
tree92a76afae3e0b6804af229b93a7491af89b43cba /vim-mode/vim_mode.pl
parentMerge branch 'dev' (diff)
downloadirssi-scripts-e4d18a03b2f94a561b7ea81248cd8ccdc8ed8481.tar.gz
irssi-scripts-e4d18a03b2f94a561b7ea81248cd8ccdc8ed8481.zip
bugfix for history movement when history list is empty.
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r--vim-mode/vim_mode.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 75a8af9..3bf43ac 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -198,7 +198,7 @@ sub cmd_movement_j {
_input('');
_input_pos(0);
$history_index = $#history + 1;
- } else {
+ } elsif ($history_index >= 0) {
_input($history[$history_index]);
_input_pos(0);
}
@@ -217,8 +217,10 @@ sub cmd_movement_k {
$history_index = $#history;
}
print "History Index: $history_index" if DEBUG;
- _input($history[$history_index]);
- _input_pos(0);
+ if ($history_index >= 0) {
+ _input($history[$history_index]);
+ _input_pos(0);
+ }
}
sub cmd_movement_h {