     getCodeFoldRowRangesContainesForRow(@editor, row).reverse()
 
   getRange: (selection) ->
-    row = @getNormalizedHeadBufferPosition(selection).row
+    row = @getCursorPositionForSelection(selection).row
     selectedRange = selection.getBufferRange()
     for rowRange in @getFoldRowRangesContainsForRow(row)
       range = @getBufferRangeForRowRange(@adjustRowRange(rowRange))


  getRange: (selection) ->
    originalRange = selection.getBufferRange()
    fromRow = @getNormalizedHeadBufferPosition(selection).row

    if @isMode('visual', 'linewise')
      if selection.isReversed()

  wise: 'linewise'

  getRange: (selection) ->
    row = @getCursorPositionForSelection(selection).row
    rowRange = @editor.languageMode.rowRangeForCommentAtBufferRow(row)
    rowRange ?= [row, row] if @editor.isBufferRowCommented(row)
    if rowRange?
