aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-10-01 18:55:44 +0000
committerSimon Ruderich <simon@ruderich.org>2010-10-01 18:55:44 +0000
commitf3b427631ba1d64ed304ed206c9e05ae0c441e0d (patch)
treeb2fc0361abf5cbb0e85785f844ecd59ed9bb3137 /vim-mode/vim_mode.pl
parentvim_mode: First work on text-objects. (diff)
downloadirssi-scripts-f3b427631ba1d64ed304ed206c9e05ae0c441e0d.tar.gz
irssi-scripts-f3b427631ba1d64ed304ed206c9e05ae0c441e0d.zip
vim_mode: Fix W between words.
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r--vim-mode/vim_mode.pl7
1 files changed, 7 insertions, 0 deletions
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);