     startPairPosition
 
   findAnyStartPair: (cursorPosition) ->
-    scanRange = new Range([0, 0], cursorPosition)
+    scanRange = new Range(Point.ZERO, cursorPosition)
     startPair = _.escapeRegExp(_.keys(@matchManager.pairedCharacters).join(''))
     endPair = _.escapeRegExp(_.keys(@matchManager.pairedCharactersInverse).join(''))
     combinedRegExp = new RegExp("[#{startPair}#{endPair}]", 'g')

  findMatchingEndPair: (startPairPosition, startPair, endPair) ->
    return if startPair is endPair

    scanRange = new Range(startPairPosition.traverse([0, 1]), startPairPosition.traverse([MAX_ROWS_TO_SCAN, 0]))
    endPairPosition = null
    unpairedCount = 0
    @editor.scanInBufferRange @matchManager.pairRegexes[startPair], scanRange, (result) =>

        endPosition = endRange.start.traverse(TWO_CHARS_BACKWARD_TRAVERSAL) # Don't select </

    if startPosition? and endPosition?
      rangeToSelect = new Range(startPosition.traverse(ONE_CHAR_FORWARD_TRAVERSAL), endPosition)
      @editor.setSelectedBufferRange(rangeToSelect)

  # Insert at the current cursor position a closing tag if there exists an
  # open tag that is not closed afterwards.
  closeTag: ->
    cursorPosition = @editor.getCursorBufferPosition()
    preFragment = @editor.getTextInBufferRange([Point.ZERO, cursorPosition])
    postFragment = @editor.getTextInBufferRange([cursorPosition, Point.INFINITY])

    if tag = @tagFinder.closingTagForFragments(preFragment, postFragment)
      @editor.insertText("</#{tag}>")
