#NEWLINE# def run( self , edit , forward = True , sub_words = False ) : #NEWLINE# #INDENT# if forward : #NEWLINE# #INDENT# classes = ( ( sublime . CLASS_WORD_END | sublime . CLASS_PUNCTUATION_END ) | sublime . CLASS_LINE_START ) #NEWLINE# if sub_words : #NEWLINE# #INDENT# classes |= sublime . CLASS_SUB_WORD_END #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# classes = ( ( sublime . CLASS_WORD_START | sublime . CLASS_PUNCTUATION_START ) | sublime . CLASS_LINE_END ) #NEWLINE# if sub_words : #NEWLINE# #INDENT# classes |= sublime . CLASS_SUB_WORD_START #NEWLINE# #UNINDENT# #UNINDENT# new_sels = [ ] #NEWLINE# for s in reversed ( self . view . sel ( ) ) : #NEWLINE# #INDENT# if s . empty ( ) : #NEWLINE# #INDENT# new_sels . append ( self . expand_word ( classes . view , s . b , classes , forward ) ) #NEWLINE# #UNINDENT# #UNINDENT# sz = self . view . size ( ) #NEWLINE# for s in new_sels : #NEWLINE# #INDENT# self . view . sel ( ) . add ( sublime . Region ( clamp ( 0 , s . a , sz ) , clamp ( 0 , s . b , sz ) ) ) #NEWLINE# #UNINDENT# self . view . run_command ( 'add_to_kill_ring' , { #NEWLINE# #INDENT# 'forward' : forward , #NEWLINE# #UNINDENT# } ) #NEWLINE# if forward : #NEWLINE# #INDENT# self . view . run_command ( 'right_delete' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . view . run_command ( 'left_delete' )