   constructor: (@editorView, @languages) ->
     super()
     @languages = Languages.getInstance()
-    @isActive = false
     @editor = @editorView.editor
     @editor.on 'grammar-changed', @checkGrammar
     @editor.on 'destroyed', @onDestroyed

  # Enabled-disabled-cycle

  checkGrammar: =>
    @deactivate()
    ext = extname(@editor.getTitle()).replace(/^\./, '')
    return unless (@language = @languages.getDefinition ext)?
    @activate()

  activate: ->
    return if @isActive

    # Start listening
    @editorView.on 'html-img:fill', @onFill

    @editorView.on 'html-img:fill-height-half', @onFillHeightHalf

  deactivate: ->
    return unless @language?

    # Stop listening
    @editorView.off 'html-img:fill', @onFill
