         @init()
 
   registerEvents: ->
+    @disposables.push atom.workspace.observeTextEditors (editor) =>
+      @disposables.push editor.onDidChangeCursorPosition (event) =>
+        if !event.textChanged
+          @documentationView.hide()
     @disposables.push atom.workspace.onDidChangeActivePaneItem =>
       @documentationView.hide()
     @disposables.push atom.config.observe 'atom-ternjs.coffeeScript', =>

    , (err) ->
      console.error 'error', err

  registerEditors: ->
    @editorSubscription = atom.workspace.observeTextEditors (editor) =>
      @disposables.push editor.onDidChangeCursorPosition (event) =>
        if !event.textChanged
          @documentationView.hide()

  unregisterEventsAndCommands: ->
    for disposable in @disposables
      disposable.dispose()

  init: ->
    @activatePackage()
    @registerCommands()

  deactivate: ->
    @stopServer()
    @unregisterEventsAndCommands()
    # autocomplete-plus
    @registration?.dispose()
    @registration = null
