 
 class ScrollHalfDownKeepCursor extends ScrollKeepingCursor
   scrollDestination: (count) ->
-    @editor.getScrollTop() + (count * Math.floor(@editor.getHeight() / 2))
+    half = (Math.floor(@editor.getRowsPerPage() / 2) * @editor.getLineHeightInPixels())
+    @editor.getScrollTop() + count * half
 
 class ScrollFullDownKeepCursor extends ScrollKeepingCursor
   scrollDestination: (count) ->


  scrollScreen: (count = 1) ->
    @previousFirstScreenRow = @editor.getFirstVisibleScreenRow()
    @editor.setScrollTop(@scrollDestination(count))
    @currentFirstScreenRow = @editor.getFirstVisibleScreenRow()

class ScrollHalfUpKeepCursor extends ScrollKeepingCursor
  scrollDestination: (count) ->
    @editor.getScrollTop() - (count * Math.floor(@editor.getHeight() / 2))

class ScrollFullUpKeepCursor extends ScrollKeepingCursor
  scrollDestination: (count) ->

    super(@editor, @vimState)

  select: (count, options) ->
    final_destination = @scrollScreen(count)
    super(count, options)
    @editor.setScrollTop(final_destination)

  execute: (count) ->
    final_destination = @scrollScreen(count)
    super(count)
    @editor.setScrollTop(final_destination)

  moveCursor: (cursor, count=1) ->
    cursor.setScreenPosition([@getDestinationRow(count), 0])
