#NEWLINE# def operator_range( self , document ) : #NEWLINE# #INDENT# '\n        Return a (start, end) tuple with start <= end that indicates the range\n        operators should operate on.\n        `buffer` is used to get start and end of line positions.\n        ' #NEWLINE# ( start , end ) = self . sorted ( ) #NEWLINE# doc = document #NEWLINE# if ( ( self . type == TextObjectType . EXCLUSIVE ) and ( doc . translate_index_to_position ( ( end + row . cursor_position ) ) [ 1 ] == 0 ) ) : #NEWLINE# #INDENT# end -= 1 #NEWLINE# #UNINDENT# if ( self . type == TextObjectType . INCLUSIVE ) : #NEWLINE# #INDENT# end += 1 #NEWLINE# #UNINDENT# if ( self . type == TextObjectType . LINEWISE ) : #NEWLINE# #INDENT# ( row , col ) = doc . translate_index_to_position ( ( start + doc . cursor_position ) ) #NEWLINE# start = ( doc . translate_row_col_to_index ( row , 0 ) - doc . cursor_position ) #NEWLINE# ( row , col ) = doc . translate_index_to_position ( ( end + doc . cursor_position ) ) #NEWLINE# end = ( doc . translate_row_col_to_index ( row , len ( doc . lines [ row ] ) ) - doc . cursor_position ) #NEWLINE# #UNINDENT# return ( start , end )