#NEWLINE# def log_change( self , undo_factory , * undo_args ) : #NEWLINE# #INDENT# ' Logs a change made in the editor.\n        ' #NEWLINE# ui = self . ui #NEWLINE# ui . modified = True #NEWLINE# undoable = ui . _undoable #NEWLINE# if ( undoable >= 0 ) : #NEWLINE# #INDENT# history = ui . history #NEWLINE# if ( history is not None ) : #NEWLINE# #INDENT# item = undo_factory ( * undo_args ) #NEWLINE# if ( item is not None ) : #NEWLINE# #INDENT# if ( undoable == history . now ) : #NEWLINE# #INDENT# history . add ( item ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# history . extend ( item )