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

  getEofBufferPosition: ->
    getEofBufferPosition(@editor)

  getLastRow: ->
    @getEofBufferPosition().row

  getFirstVisibleScreenRow: ->

      when 'FirstScreenRow'
        cursor.getScreenRow() is 0
      when 'LastBufferRow'
        cursor.getBufferRow() is @getLastBufferRow()
      when 'LastScreenRow'
        cursor.getScreenRow() is @editor.getLastScreenRow()

