   # Move lines intersection the most recent selection or multiple selections up by one row in screen
   # coordinates.
   moveLineUp: ->
-    selections = @getSelectionsOrderedByBufferPosition()
-
-    if selections[0].getBufferRange().start.row is 0
+    selections = @getSelectedBufferRanges()
+    selections.sort (a, b) -> a.compare(b)
+
+    if selections[0].start.row is 0
       return
 
-    if selections[selections.length - 1].getBufferRange().start.row is @getLastBufferRow() and @buffer.getLastLine() is ''
+    if selections[selections.length - 1].start.row is @getLastBufferRow() and @buffer.getLastLine() is ''
       return
 
     @transact =>


        # Make sure the inserted text doesn't go into an existing fold
        if fold = @displayBuffer.largestFoldStartingAtBufferRow(precedingBufferRow)
          rangesToRefold.push(fold.getBufferRange().translate([linesRange.getRowCount(), 0]))
          fold.destroy()

        # Delete lines spanned by selection and insert them on the preceding buffer row

      while selections.length > 0
        # Find selections spanning a contiguous set of lines
        selection = selections.shift()
        selectionsToMove = [selection]

        while selection.end.row is selections[0]?.start.row
          selection = selections.shift()
          selectionsToMove.push(selection)

        # Compute the range spanned by all these selections...
        linesRangeStart = [selection.start.row, 0]
        if selection.end.row > selection.start.row and selection.end.column is 0
          # Don't move the last line of a multi-line selection if the selection ends at column 0
          linesRange = new Range(linesRangeStart, selection.end)
        else
          linesRange = new Range(linesRangeStart, [selection.end.row + 1, 0])

        # If selected line range is preceded by a fold, one line above on screen
        # could be multiple lines in the buffer.
