         if linter.scope is 'project' then @linter.messagesProject.set linter, results
         else @messages.set linter, results
 
-        @emitter.emit 'did-update'
+        @_emitter.emit 'did-update'
         @linter.views.render() if @editor is @linter.activeEditor
 
   # This method sets or gets the lock status of given type
   _lock: (wasTriggeredOnChange, value) ->
-    key = wasTriggeredOnChange ? 'inProgressFly' : 'inProgress'
+    key = wasTriggeredOnChange ? "_inProgressFly" : 'inProgress'
     if typeof value is 'undefined'
       @[key]
     else


class EditorLinter
  constructor: (@linter, @editor) ->
    @inProgress = false
    @inProgressFly = false
    @messages = new Map

    @emitter = new Emitter
    @subscriptions = new CompositeDisposable

    @subscriptions.add(
      @editor.onDidSave => @lint(false)
    )
    @subscriptions.add(
      @editor.onDidChangeCursorPosition ({newBufferPosition}) =>
        @linter.views.updateBubble(newBufferPosition)
    )
    @subscriptions.add(
      @editor.onDidStopChanging => @lint(true) if @linter.lintOnFly
    )

  # Called on package deactivate
  destroy: ->
    @emitter.emit 'did-destroy'
    @subscriptions.dispose()

  onDidUpdate: (callback) ->
    @emitter.on 'did-update', callback

  onDidDestroy: (callback) ->
    @emitter.on 'did-destroy', callback

  lint: (wasTriggeredOnChange) ->
    return unless @editor is @linter.activeEditor

      result.range = Range.fromObject result.range if result.range?
      EditorLinter._validateResults(result.trace) if result.trace
    results

module.exports = EditorLinter