       return index if markerStartPosition.isEqual(start) and indexIncluded
       return index if markerStartPosition.isGreaterThan(start)
     0
+
+  firstMarkerIndexFromCursor: =>
+    @firstMarkerIndexAfterCursor(true)
 
   selectFirstMarkerBeforeCursor: =>
     markerIndex = @firstMarkerIndexBeforeCursor()

      atom.beep()

  replaceNext: =>
    @replace('findNext', => @firstMarkerIndexAfterCursor(true))

  replacePrevious: =>
    @replace('findPrevious', 'firstMarkerIndexBeforeCursor')


    if @markers?.length > 0
      unless currentMarker = @model.currentResultMarker
        markerIndex = @[nextIndexFn]()
        currentMarker = @markers[markerIndex]

      @model.replace([currentMarker], @replaceEditor.getText())
