 class MoveToLastLine extends MoveToFirstLine
   @extend()
   getDefaultRow: ->
-    @getLastRow()
+    @getLastBufferRow()
 
 # keymap: N% e.g. 10%
 class MoveToLineByPercent extends MoveToFirstLine
   @extend()
   getRow: ->
     percent = Math.min(100, @getCount())
-    Math.floor(@getLastRow() * (percent / 100))
+    Math.floor(@getLastBufferRow() * (percent / 100))
 
 class MoveToRelativeLine extends Motion
   @extend(false)

  @extend()
  getRow: ->
    row = @getLastVisibleScreenRow()
    offset = if row is @getLastRow() then 0 else @scrolloff
    row - Math.max(@getCount(), offset)

# keymap: M

        if next.isEqual(cursor.getBufferPosition())
          cursor.moveToEndOfWord()
        else
          if next.row is @getLastBufferRow() + 1
            cursor.moveToEndOfWord()
          else
            cursor.setBufferPosition(next)
