 shell = require 'shell'
-{Editor, View} = require 'atom'
+{$$$, Editor, View} = require 'atom'
 FindModel = require './find-model'
 FindResultsView = require './find-results-view'
 History = require './history'


  @content: ->
    @div tabIndex: -1, class: 'find-and-replace tool-panel panel-bottom', =>
      @div class: 'find-container block', =>
        @label class: 'text-subtle', 'Find'


    pattern = @findModel.getEditSession().getSelectedText()
    @findModel.update {pattern}

  clearMessages: ->
    @errorMessages.hide().empty()
    @infoMessages.hide().empty()

  addInfoMessage: (message) ->
    @infoMessages.append($$$ -> @li message)
    @infoMessages.show()

  addErrorMessage: (message) ->
    @errorMessages.append($$$ -> @li message)
    @errorMessages.show()

  toggleRegexOption: =>
    @findModel.update {pattern: @findEditor.getText(), useRegex: !@findModel.useRegex}
    @selectFirstMarkerAfterCursor()
