 
     # Deactivate old mode
     if (mode isnt @mode)
-      @emitter.emit('will-deactivate-mode', {@mode, @submode})
+      @emitter.emit 'will-deactivate-mode', {@mode, @submode}
       @deactivator?.dispose()
 
     # Activate


  onWillDeactivateMode: (fn) ->
    @emitter.on 'will-deactivate-mode', fn

  # activate: Public
  #  Use this method to change mode, DONT use other direct method.

    {@editor, @editorElement} = @vimState
    @emitter = new Emitter

    @onDidActivateMode ({mode, submode}) =>
      @vimState.showCursors()
      # Update selecter class
      for mode in supportedModes
        toggleClassByCondition(@editorElement, "#{mode}-mode", mode is @mode)
      for submode in supportedSubModes
        toggleClassByCondition(@editorElement, submode, submode is @submode)
      @vimState.statusBarManager.update(mode, submode)

  eachSelection: (fn) ->
    eachSelection(@editor, fn)

