#NEWLINE# def find_next_word_ending( self , include_current_position = False , count = 1 , WORD = False ) : #NEWLINE# #INDENT# '\n        Return an index relative to the cursor position pointing to the end\n        of the next word. Return `None` if nothing was found.\n        ' #NEWLINE# if include_current_position : #NEWLINE# #INDENT# text = self . text_after_cursor #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# text = self . text_after_cursor [ 1 : ] #NEWLINE# #UNINDENT# regex = ( _FIND_BIG_WORD_RE if WORD else _FIND_WORD_RE ) #NEWLINE# iterable = regex . finditer ( text ) #NEWLINE# try : #NEWLINE# #INDENT# for ( i , match ) in enumerate ( iterable ) : #NEWLINE# #INDENT# if ( ( i + 1 ) == count ) : #NEWLINE# #INDENT# value = match . end ( 1 ) #NEWLINE# if include_current_position : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( text + 1 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except StopIteration : #NEWLINE# #INDENT# pass