aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode_visual_edit.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-01-30 09:37:28 +0000
committerStephen Blott2015-01-30 09:37:28 +0000
commite268f1fd57e364feacf372bac92d991fd3abe603 (patch)
treeddab8887e78caa902340415a4ab44b7d6f3cc6a5 /content_scripts/mode_visual_edit.coffee
parent0029863f32be7cb079c43faeb9df84b0718f147d (diff)
downloadvimium-e268f1fd57e364feacf372bac92d991fd3abe603.tar.bz2
Visual/edit modes: handle "0" as count prefix, when appropriate.
Diffstat (limited to 'content_scripts/mode_visual_edit.coffee')
-rw-r--r--content_scripts/mode_visual_edit.coffee6
1 files changed, 5 insertions, 1 deletions
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee
index 842f6c0a..33e854c8 100644
--- a/content_scripts/mode_visual_edit.coffee
+++ b/content_scripts/mode_visual_edit.coffee
@@ -221,8 +221,8 @@ class Movement extends CountPrefix
"(": "backward sentence"
"}": "forward paragraph"
"{": "backward paragraph"
- "$": "forward lineboundary"
"0": "backward lineboundary"
+ "$": "forward lineboundary"
"G": "forward documentboundary"
"gg": "backward documentboundary"
@@ -255,6 +255,10 @@ class Movement extends CountPrefix
@selection = window.getSelection()
@keyQueue = ""
+ # We need to treat "0" specially. It can be either a movement, or a continutation of a count
+ # prefix. Don't treat it as a movement if we already have a count prefix.
+ return @continueBubbling if command == "0" and 0 < @countPrefix
+
if @commands[command]
@commands[command].call @, @getCountPrefix()
@scrollIntoView()