diff options
| author | Stephen Blott | 2016-03-21 12:44:19 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2016-03-21 12:44:19 +0000 | 
| commit | a6fc63636c4e815ae128a8a15e7cf13ea028b297 (patch) | |
| tree | 84c395bb0ebd11d2235b10b24796794ff69315d3 | |
| parent | 741bc131353eb856022d66252309de23a0873fc7 (diff) | |
| download | vimium-a6fc63636c4e815ae128a8a15e7cf13ea028b297.tar.bz2 | |
Rework cisual mode; tweaks and fixes.
| -rw-r--r-- | content_scripts/mode_visual.coffee | 16 | 
1 files changed, 2 insertions, 14 deletions
| diff --git a/content_scripts/mode_visual.coffee b/content_scripts/mode_visual.coffee index a6102987..c2d1037b 100644 --- a/content_scripts/mode_visual.coffee +++ b/content_scripts/mode_visual.coffee @@ -23,18 +23,6 @@ class Movement      else        beforeText[0] # The existing range selection is backwards. -  # As above, but backwards. -  getNextBackwardCharacter: -> -    beforeText = @selection.toString() -    if beforeText.length == 0 or @getDirection() == backward -      @selection.modify "extend", backward, character -      afterText = @selection.toString() -      if beforeText != afterText -        @selection.modify "extend", forward, character -        afterText[0] -    else -      beforeText[beforeText.length - 1] # The existing range selection is forwards. -    # Test whether the character following the focus is a word character (and leave the selection unchanged).    nextCharacterIsWordCharacter: do ->      regexp = null @@ -201,7 +189,7 @@ class VisualMode extends KeyHandlerMode      "N": (count) -> @find count, true      "/": ->        @exit() -      new FindMode(returnToViewport: true).onExit => new VisualMode +      new FindMode(returnToViewport: true).onExit -> new VisualMode      "y": -> @yank()      "Y": (count) -> @movement.selectLine count; @yank() @@ -283,7 +271,7 @@ class VisualMode extends KeyHandlerMode          @movement.runMovement command for [0...count] by 1        when "function"          command count -    return # Prevent CoffeeScript building an array (for the "string" case, above). +    @movement.scrollIntoView()    find: (count, backwards) =>      initialRange = @selection.getRangeAt(0).cloneRange() | 
