 
   syncToEditor: (editor) ->
     return if @preventSyncToEditor
-    return if @isActive()
     if item = @findClosestItemForEditor(editor)
       @selectItem(item)
       {row} = @editor.getCursorBufferPosition()


    @syncSubcriptions?.dispose()
    @syncSubcriptions = new CompositeDisposable

    syncToEditor = @syncToEditor.bind(this, editor)
    syncToEditor()

    ignoreColumnChange = @provider.ignoreSideMovementOnSyncToEditor

    @syncSubcriptions.add editor.onDidChangeCursorPosition (event) ->
      return unless isActiveEditor(editor)
      return if event.textChanged
      return if ignoreColumnChange and (event.oldBufferPosition.row is event.newBufferPosition.row)
      syncToEditor()

    @syncSubcriptions.add @onDidRefresh(syncToEditor)

    refresh = => @refresh(force: true) unless @isActive()

    if @provider.boundToEditor
      # Surppress refreshing while editor is active to avoid auto-refreshing while direct-edit.
      @syncSubcriptions.add editor.onDidStopChanging(refresh)
    else
      @syncSubcriptions.add editor.onDidSave(refresh)

    @previewItemForDirection('previous')

  getQuery: ->
    @editor.lineTextForBufferRow(0)

  excludeFile: ->
    return if @provider.boundToEditor
