 
   clearSequence: () ->
     @curSequence = []
-
-  handleMotion: (motion, options = {}) ->
-    motion.repeat ?= 1
-
-    cursor = do @view.cursor.clone
-
-    for i in [1..motion.repeat]
-      if motion.type == 'LEFT'
-        cursor.left options
-      else if motion.type == 'RIGHT'
-        cursor.right options
-      else if motion.type == 'UP'
-        cursor.up options
-      else if motion.type == 'DOWN'
-        cursor.down options
-      else if motion.type == 'HOME'
-        cursor.home options
-      else if motion.type == 'END'
-        cursor.end options
-      else if motion.type == 'BEGINNING_WORD'
-        cursor.beginningWord options
-      else if motion.type == 'END_WORD'
-        cursor.endWord options
-      else if motion.type == 'NEXT_WORD'
-        cursor.nextWord options
-      else if motion.type == 'BEGINNING_BLOCK'
-        options.block = true
-        cursor.beginningWord options
-      else if motion.type == 'END_BLOCK'
-        options.block = true
-        cursor.endWord options
-      else if motion.type == 'NEXT_BLOCK'
-        options.block = true
-        cursor.nextWord options
-      else if motion.type == 'FIND_NEXT_CHAR'
-        cursor.nextChar motion.char, options
-      else if motion.type == 'TO_NEXT_CHAR'
-        options.beforeFound = true
-        cursor.nextChar motion.char, options
-      else if motion.type == 'FIND_PREV_CHAR'
-        cursor.prevChar motion.char, options
-      else if motion.type == 'TO_PREV_CHAR'
-        options.beforeFound = true
-        cursor.prevChar motion.char, options
-      else
-        return null
-    return cursor
 
   handleKeys: (keys) ->
     for key in keys

      alternateKeys: ['tab']
      fn: () ->
        @view.indentLine {}
        return SEQUENCE.FINISH
    INDENT_LEFT:
      display: 'Indent left'
      key: '<'
      alternateKeys: ['shift+tab']
      fn: () ->
        @view.unindentLine {}
        return SEQUENCE.FINISH
    INDENT_BLOCK_RIGHT:
      display: 'Indent block right'
      key: ']'
      fn: () ->
        @view.indentBlock {recursive: true}
        return SEQUENCE.FINISH
    INDENT_BLOCK_LEFT:
      display: 'Indent block left'
      key: '['
      fn: () ->
        @view.unindentBlock {recursive: true}
        return SEQUENCE.FINISH
    TOGGLE_FOLD:
      display: 'Toggle whether a block is folded'
      key: 'z'
      fn: () ->
        do @view.toggleCurBlock
        return SEQUENCE.FINISH

    SCROLL_DOWN:
      display: 'Scroll half window down'
      key: 'ctrl+d'
      fn: () ->
        @view.scrollPages 0.5
        return SEQUENCE.DROP
    SCROLL_UP:
      display: 'Scroll half window down'
      key: 'ctrl+u'
      fn: () ->
        @view.scrollPages -0.5
        return SEQUENCE.DROP

  SEQUENCE = {
    # wait for more keys

    getMotion = (motionKey) =>
      if not motionKey
        motionKey = do nextKey
      [repeat, motionKey] = getRepeat motionKey
      if motionKey == null then return [null, SEQUENCE.WAIT]

