#NEWLINE# def index( self ) : #NEWLINE# #INDENT# 'Move the cursor down one line in the same column. If the\n        cursor is at the last line, create a new line at the bottom.\n        ' #NEWLINE# margins = self . margins #NEWLINE# if ( margins is None ) : #NEWLINE# #INDENT# cursor_position = self . pt_cursor_position #NEWLINE# cursor_position . y += 1 #NEWLINE# self . max_y = max ( self . max_y , cursor_position . y ) #NEWLINE# self . _history_cleanup_counter += 1 #NEWLINE# if ( self . _history_cleanup_counter == 100 ) : #NEWLINE# #INDENT# self . _remove_old_lines_from_history ( ) #NEWLINE# self . _history_cleanup_counter = 0 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ( top , bottom ) = self . margins #NEWLINE# line_offset = self . line_offset #NEWLINE# if ( ( self . pt_cursor_position . y - line_offset ) == bottom ) : #NEWLINE# #INDENT# data_buffer = self . data_buffer #NEWLINE# for line in range ( top , bottom ) : #NEWLINE# #INDENT# data_buffer [ ( line + line_offset ) ] = data_buffer [ ( ( line + self ) + 1 ) ] #NEWLINE# data_buffer . pop ( ( ( line + line_offset ) + 1 ) , None ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . cursor_down ( )