 
 # This implements various selection movements.
 class Movement
-  opposite: forward: backward, backward: forward
 
   constructor: (@alterMethod) ->
+    @opposite = forward: backward, backward: forward
     @selection = window.getSelection()
 
   # Return the character following (to the right of) the focus, and leave the selection unchanged, or return

      @setSelectionRange range
      which = if direction == forward then "start" else "end"
      @selection.extend original["#{which}Container"], original["#{which}Offset"]

  # Try to extend the selection by one character in direction.  Return positive, negative or 0, indicating
  # whether the selection got bigger, or smaller, or is unchanged.

      # because the normal method (below) does not work within text areas, etc.
      length = @selection.toString().length
      @collapseSelectionToFocus()
      for [0...length] by 1
        @runMovement @opposite[direction], character
    else
      # Normal method.
      original = @selection.getRangeAt(0).cloneRange()
