From 4ef6cab66ed2fccc0f9ded17545ecc7b4c3c97ba Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 27 Sep 2010 01:14:01 +0200 Subject: vim_mode: Fix _end_of_WORD() when called at the end of the line. --- vim-mode/vim_mode.pl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vim-mode') 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]; -- cgit v1.2.3