 
   setReversedState: (reversed) ->
     return if @selection.isReversed() is reversed
-    {head, tail, wise} = @getProperties()
-    if head? and tail?
+
+    if @hasProperties()
+      {head, tail, wise} = @getProperties()
       @setProperties(head: tail, tail: head, wise: wise)
 
     options = {autoscroll: true, reversed, preserveFolds: true}

    @setProperties(properties)

  fixPropertiesForLinewise: ->
    selectionProperties = @getProperties()
    return unless selectionProperties
    {head, tail, wise} = selectionProperties
    if @selection.isReversed()
      [start, end] = [head, tail]
    else
      [start, end] = [tail, head]
    [startRow, endRow] = @selection.getBufferRowRange()

    start.row = startRow unless startRow is start.row
    end.row = endRow unless endRow is end.row


  setWise: (value) ->
    @saveProperties() unless @hasProperties()
    properties = @getProperties()
    properties.wise = value

  getWise: ->
    @getProperties()?.wise ? 'characterwise'


  restoreFromProperties: ->
    return unless @hasProperties()
    @withKeepingGoalColumn =>
      @selectByProperties(@getProperties())

  # Only for setting autoscroll option to false by default
  setBufferRange: (range, options={}) ->
