aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 {