     @editor.getSelections().forEach (selection) ->
       data =
         if isLinewise
-          swrap(selection).getRows().map(-> '')
+          height = swrap(selection).getRows().length
+          Array(height).fill('')
         else
-          [_.multiplyString(' ', selection.getBufferRange().getExtent().column)]
+          width = selection.getBufferRange().getExtent().column
+          [' '.repeat(width)]
       overwrittenBySelection.set(selection, data)
     overwrittenBySelection
 

    @withUndoJoin =>
      selections = @editor.getSelectionsOrderedByBufferPosition()
      return if @isCharacterwise() and (not @isMovable(selections[0]))
      selections.reverse() if @direction is 'down'
      @editor.transact =>
        @countTimes =>
          @mutateSelections(selections)

        @editor.getSelections().some (selection) ->
          not swrap(selection).isSingleRow()

  duplicateText: (selection, count) ->
    if @isLinewise()
      rows = swrap(selection).lineTextForBufferRows()
      switch @direction
        when 'up', 'down' then _.flatten([1..count].map -> rows)
        when 'left', 'right' then rows.map (text) -> text.repeat(count+1)
    else
      text = selection.getText()
      switch @direction
        when 'up', 'down' then [1..count].map -> text
        when 'left', 'right' then [text.repeat(count)]

class DuplicateSelectedTextUp extends DuplicateSelectedText
  direction: 'up'
