#NEWLINE# def recvEdit( self , editType , content ) : #NEWLINE# #INDENT# '\n        Callback method for handling edit events from the peer.\n\n        @param editType: C{str} edit type (see above)\n        @param content: C{Array} contents of the edit (None if delete editType)\n        ' #NEWLINE# self . view . set_read_only ( False ) #NEWLINE# if ( editType == base . EDIT_TYPE_INSERT ) : #NEWLINE# #INDENT# self . view . run_command ( 'insert' , { #NEWLINE# #INDENT# 'characters' : content , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_INSERT_SNIPPET ) : #NEWLINE# #INDENT# self . view . run_command ( 'insert_snippet' , { #NEWLINE# #INDENT# 'contents' : editType , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_LEFT_DELETE ) : #NEWLINE# #INDENT# self . view . run_command ( 'left_delete' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_RIGHT_DELETE ) : #NEWLINE# #INDENT# self . view . run_command ( 'right_delete' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_CUT ) : #NEWLINE# #INDENT# self . view . run_command ( 'left_delete' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_COPY ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_PASTE ) : #NEWLINE# #INDENT# paste_edit = self . view . begin_edit ( ) #NEWLINE# for region in self . view . sel ( ) : #NEWLINE# #INDENT# self . view . replace ( paste_edit , region , content ) #NEWLINE# #UNINDENT# self . view . end_edit ( paste_edit ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_UNDO ) : #NEWLINE# #INDENT# self . view . run_command ( 'undo' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_REDO ) : #NEWLINE# #INDENT# self . view . run_command ( 'redo' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_REDO_OR_REPEAT ) : #NEWLINE# #INDENT# self . view . run_command ( 'redo_or_repeat' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_SOFT_UNDO ) : #NEWLINE# #INDENT# self . view . run_command ( 'soft_undo' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( editType == base . EDIT_TYPE_SOFT_REDO ) : #NEWLINE# #INDENT# self . view . run_command ( 'soft_redo' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# self . view . set_read_only ( True )