aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-26 23:14:01 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-26 23:14:01 +0000
commit4ef6cab66ed2fccc0f9ded17545ecc7b4c3c97ba (patch)
treecfaaac571d660267e5da93db2208fa9747b6e2c0 /vim-mode/vim_mode.pl
parentvim_mode: Correctly handle multiple whitespace between words. (diff)
downloadirssi-scripts-4ef6cab66ed2fccc0f9ded17545ecc7b4c3c97ba.tar.gz
irssi-scripts-4ef6cab66ed2fccc0f9ded17545ecc7b4c3c97ba.zip
vim_mode: Fix _end_of_WORD() when called at the end of the line.
Diffstat (limited to '')
-rw-r--r--vim-mode/vim_mode.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index d1dde46..416b753 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -443,6 +443,8 @@ sub cmd_movement_E {
sub _end_of_WORD {
my ($input, $count, $pos) = @_;
+ return $pos if $pos >= length($input);
+
# We are inside a word, skip to the end of it.
if (substr($input, $pos + 1) =~ /^\S+(\s)/) {
$pos += $-[1];