diff options
| author | Tom Feist <shabble@cowu.be> | 2010-09-26 00:57:41 +0000 | 
|---|---|---|
| committer | Tom Feist <shabble@cowu.be> | 2010-09-26 00:57:41 +0000 | 
| commit | e4d18a03b2f94a561b7ea81248cd8ccdc8ed8481 (patch) | |
| tree | 92a76afae3e0b6804af229b93a7491af89b43cba | |
| parent | Merge branch 'dev' (diff) | |
| download | irssi-scripts-e4d18a03b2f94a561b7ea81248cd8ccdc8ed8481.tar.gz irssi-scripts-e4d18a03b2f94a561b7ea81248cd8ccdc8ed8481.zip | |
bugfix for history movement when history list is empty.
| -rw-r--r-- | vim-mode/vim_mode.pl | 8 | 
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 { | 
