 class VisualBlockwise extends Base
   @extend()
   complete: true
+
+  initialize: ->
+    # PlantTail
+    unless @getTail()?
+      @updateProperties {head: @getBottom(), tail: @getTop()}
 
   eachSelection: (fn) ->
     for s in @editor.getSelections()

      startColumn += 1
      endColumn -= 1

    ranges = ([[row, startColumn], [row, endColumn]] for row in [startRow..endRow])
    @editor.setSelectedBufferRanges(ranges, {reversed})
    if wasReversed


class BlockwiseRestoreCharacterwise extends VisualBlockwise
  @extend()

  execute: ->
    reversed = @isReversed()
    head = @getHead()
    headIsReversed = head.isReversed()
    [startRow, endRow] = @getBufferRowRange()
    {start: {column: startColumn}, end: {column: endColumn}} = head.getBufferRange()
    if reversed isnt headIsReversed
      [startColumn, endColumn] = [endColumn, startColumn]
      startColumn -= 1
      endColumn += 1
    range = [[startRow, startColumn], [endRow, endColumn]]
    @editor.setSelectedBufferRange(range, {reversed})

module.exports = {
