 
 # Debugging purpose
 # -------------------------
+logGoalColumnForSelection = (subject, selection) ->
+  console.log "#{subject}: goalColumn = ", selection.cursor.goalColumn
+
 reportSelection = (subject, selection) ->
   console.log subject, selection.getBufferRange().toString()
 

moveCursorLeft = (cursor, options={}) ->
  {allowWrap} = options
  delete options.allowWrap
  if not cursor.isAtBeginningOfLine() or allowWrap
    moveCursor cursor, options, (cursor) ->
      cursor.moveLeft()

moveCursorRight = (cursor, options={}) ->
  {allowWrap} = options
  delete options.allowWrap
  if not cursor.isAtEndOfLine() or allowWrap
    moveCursor cursor, options, (cursor) ->
      cursor.moveRight()

moveCursorUp = (cursor, options={}) ->
  unless cursor.getScreenRow() is 0
    moveCursor cursor, options, (cursor) ->
      cursor.moveUp()

moveCursorDown = (cursor, options={}) ->
  unless getVimLastScreenRow(cursor.editor) is cursor.getScreenRow()
    moveCursor cursor, options, (cursor) ->
      cursor.moveDown()

# FIXME
moveCursorDownBuffer = (cursor) ->

  reportSelection,
  reportCursor
  withTrackingCursorPositionChange
  logGoalColumnForSelection
}
