diff options
| author | Stephen Blott | 2015-01-31 13:01:18 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-31 13:01:18 +0000 |
| commit | 11199de98a2c29601e38e75af561057ab55a0a83 (patch) | |
| tree | a5b00f598e5e59704a1e4db8f67d26bc95f2b37c /content_scripts | |
| parent | 6cff1b0dfccdb137e95e52c9a931fed14cec82d5 (diff) | |
| download | vimium-11199de98a2c29601e38e75af561057ab55a0a83.tar.bz2 | |
Visual/edit modes: change implementation of vimword.
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/mode_visual_edit.coffee | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee index d936ac1e..253d892a 100644 --- a/content_scripts/mode_visual_edit.coffee +++ b/content_scripts/mode_visual_edit.coffee @@ -124,8 +124,10 @@ class Movement extends CountPrefix beforeText[beforeText.length - 1] # Test whether the character following the focus is a word character. Leave the selection unchanged. + # We include "." as a word character here. With this, "w" sometimes jumps one word too far. However, it's + # better than leaving it out, in which case "w" jumps backwards! nextCharacterIsWordCharacter: do -> - regexp = /[A-Za-z0-9_]/ + regexp = /[A-Za-z0-9_]|\./ -> regexp.test @getNextForwardCharacter() # Run a movement. For convenience, the following three argument forms are available: @@ -147,7 +149,7 @@ class Movement extends CountPrefix # Perform the movement. if movement[1] == vimword and movement[0] == forward if @nextCharacterIsWordCharacter() - @runMovements [ forward, word ], [ forward, vimword ] + @runMovements [ forward, word ], [ forward, word ], [ backward, word ] else @runMovements [ forward, word ], [ backward, word ] |
