From e268f1fd57e364feacf372bac92d991fd3abe603 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 30 Jan 2015 09:37:28 +0000 Subject: Visual/edit modes: handle "0" as count prefix, when appropriate. --- content_scripts/mode_visual_edit.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'content_scripts') 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() -- cgit v1.2.3