         if startRange.compare(endRange) > 0
           [startRange, endRange] = [endRange, startRange]
         startPosition = startRange.end
-        endPosition = endRange.start.translate([0, -2]) # Don't select </
+        endPosition = endRange.start.add([0, -2]) # Don't select </
 
     if startPosition? and endPosition?
-      rangeToSelect = new Range(startPosition, endPosition).translate([0, 1], [0, 0])
+      rangeToSelect = new Range(startPosition.add([0, 1]), endPosition)
       @editor.setSelectedBufferRange(rangeToSelect)
 
   # Insert at the current cursor position a closing tag if there exists an

        @editor.backspace()

  findMatchingEndPair: (startPairPosition, startPair, endPair) ->
    scanRange = new Range(startPairPosition.translate([0, 1]), @editor.buffer.getEndPosition())
    endPairPosition = null
    unpairedCount = 0
    @editor.scanInBufferRange pairRegexes[startPair], scanRange, ({match, range, stop}) ->

        matchPosition = @findMatchingStartPair(position, matchingPair, currentPair)

    if position? and matchPosition?
      @moveStartView([position, position.add([0, 1])])
      @moveEndView([matchPosition, matchPosition.add([0, 1])])
      @pairHighlighted = true
    else
      if pair = @tagFinder.findMatchingTags()
