From e4d18a03b2f94a561b7ea81248cd8ccdc8ed8481 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sun, 26 Sep 2010 01:57:41 +0100 Subject: bugfix for history movement when history list is empty. --- vim-mode/vim_mode.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'vim-mode') 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 { -- cgit v1.2.3