diff options
| author | Stephen Blott | 2015-02-02 09:40:54 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2015-02-02 09:40:54 +0000 | 
| commit | 0028886ea455ef09386ff822727fd666c666da35 (patch) | |
| tree | 95713946ed4a80d6c3dece83944d66591da97eb5 /content_scripts/mode_visual_edit.coffee | |
| parent | edfe3d0ce2726e90559b200f607dc0dec48526b9 (diff) | |
| download | vimium-0028886ea455ef09386ff822727fd666c666da35.tar.bz2 | |
Visual/edit modes: escape in visual mode clears selection.
Diffstat (limited to 'content_scripts/mode_visual_edit.coffee')
| -rw-r--r-- | content_scripts/mode_visual_edit.coffee | 16 | 
1 files changed, 1 insertions, 15 deletions
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee index 749559f7..0bc0639e 100644 --- a/content_scripts/mode_visual_edit.coffee +++ b/content_scripts/mode_visual_edit.coffee @@ -111,7 +111,7 @@ class Movement extends CountPrefix      if @options.parentMode        @options.parentMode.launchSubMode mode, options      else -      new mode extend options, initialRangeOnLaunch: @initialRangeOnLaunch +      new mode options    # Return the character following (to the right of) the focus, and leave the selection unchanged.  Returns    # undefined if there is no such character. @@ -309,11 +309,6 @@ class Movement extends CountPrefix        @runMovementKeyChar @options.immediateMovement, @getCountPrefix()        return -    # Track the initial selection range.  We'll restore it if the user exits with Escape. -    unless @options.parentMode -      @initialRangeOnLaunch = options.initialRangeOnLaunch || -        (if @selection.type == "None" then "None" else @selection.getRangeAt 0) -      # This is the main keyboard-event handler for movements and commands.      @push        _name: "#{@id}/keypress" @@ -370,15 +365,6 @@ class Movement extends CountPrefix    exit: (event, target) ->      super event, target -    unless @options.parentMode -      # When the user exits via Escape, we reinstall the pre-launch selection (or, if there was none, just -      # collapse the selection to the current anchor). -      if @initialRangeOnLaunch? and event?.type == "keydown" and KeyboardUtils.isEscape event -        if @initialRangeOnLaunch == "None" -          @collapseSelectionToAnchor() -        else -          @setSelectionRange @initialRangeOnLaunch unless @initialRangeOnLaunch == "None" -    # Yank the selection; always exits; either deletes the selection or collapses it; set @yankedText and    # returns it.    yank: (args = {}) ->  | 
