#NEWLINE# def add_history( self , line ) : #NEWLINE# #INDENT# 'Append a line to the history buffer, as if it was the last line typed.' #NEWLINE# if ( not line . get_line_text ( ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( len ( self . history ) > 0 ) and ( self . history [ ( - 1 ) ] . get_line_text ( ) == line . get_line_text ( ) ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . history . append ( line ) #NEWLINE# #UNINDENT# #UNINDENT# self . history_cursor = len ( self . history )