 class InputMethod extends EventEmitter
 
     activated: false
-    muteEvent: false
+    mute: false
 
     # raw characters
     inputBuffer: ''

                    @emit 'delete', range, textBuffer



    deactivate: ->

        if @activated
            log 'IM', 'deactivated'
            @core.panel.deactivateIM()
            @decorator.hide()
            @textBufferMarker.destroy()
            @activated = false

    getRange: ->
        new Range(@startPosition, @startPosition.translate(new Point 0, @outputBuffer.length))

            # we shall leave 1 backslash in the buffer, then deactivate
            @deactivate()

    deactivate: ->

        if @activated
            log 'IM', 'deactivated'
            @core.panel.deactivateIM()
            @decorator.hide()
            @textBufferMarker.destroy()
            @activated = false

    ##################
    ###   Events   ###
    ##################

    muteEvent: (callback) ->
        @mute = true
        callback()
        @mute = false

    dispatchEvent: (ev) =>

        # see if the text buffer's resized
        range = new Range ev.newTailBufferPosition, ev.newHeadBufferPosition
