     else if showReplace
       @showReplace()
 
+    @clearMessages()
+
   serialize: ->
     findHistory: @findHistory.serialize()
     replaceHistory: @replaceHistory.serialize()

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

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


    @resultCounter.text text

  selectFirstMarkerAfterCursor: =>
    markerIndex = @firstMarkerIndexAfterCursor()
    @selectMarkerAtIndex(markerIndex)

