From f3b427631ba1d64ed304ed206c9e05ae0c441e0d Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 1 Oct 2010 20:55:44 +0200 Subject: vim_mode: Fix W between words. --- vim-mode/vim_mode.pl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vim-mode') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index e861c71..9d3314d 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -741,6 +741,13 @@ sub cmd_movement_E { sub _beginning_of_WORD { my ($input, $count, $pos) = @_; + # Necessary for correct movement between two words with only one + # whitespace. + if (substr($input, $pos) =~ /^\s\S/) { + $pos++; + $count--; + } + while ($count-- > 0 and length($input) > $pos) { if (substr($input, $pos + 1) !~ /\s+/) { return length($input); -- cgit v1.2.3