   isActiveEditor
   getValidIndexForList
   setBufferRow
+  isTextEditor
 } = require './utils'
 settings = require './settings'
 Grammar = require './grammar'

    if (row = @getRowForSelectedItem()) >= 0
      oldPosition = @editor.getCursorBufferPosition()
      @withIgnoreCursorMove =>
        @editor.setCursorBufferPosition([row, oldPosition.column])
        @emitDidMoveToItemArea() if @isPromptRow(oldPosition.row)

  setRowMarker: (editor, point) ->

    @syncSubcriptions.add @onDidRefresh =>
      @syncToEditor(editor) unless @isActive()

    if @provider.boundToEditor
      @syncSubcriptions.add editor.onDidStopChanging =>
        # Surppress refreshing while editor is active to avoid auto-refreshing while direct-edit.
        @refresh(force: true) if isActiveEditor(editor)
    else
      @syncSubcriptions.add editor.onDidSave =>
        @refresh(force: true) unless @isActive()

  # vim-mode-plus integration
  # -------------------------
  vmpActivateNormalMode: ->
