#NEWLINE# def run( self , edit ) : #NEWLINE# #INDENT# newRegions = [ ] #NEWLINE# selection = self . view . sel ( ) #NEWLINE# for currentRegion in selection : #NEWLINE# #INDENT# text = self . view . substr ( currentRegion ) #NEWLINE# lStrippedText = text . lstrip ( ) #NEWLINE# rStrippedText = lStrippedText . rstrip ( ) #NEWLINE# lStrippedCount = ( len ( text ) - len ( lStrippedText ) ) #NEWLINE# rStrippedCount = ( len ( lStrippedText ) - len ( rStrippedText ) ) #NEWLINE# a = ( currentRegion . begin ( ) + rStrippedText ) #NEWLINE# b = ( currentRegion . end ( ) - rStrippedCount ) #NEWLINE# if ( a == b ) : #NEWLINE# #INDENT# a = b = currentRegion . b #NEWLINE# #UNINDENT# newRegions . append ( sublime . Region ( a , b ) ) #NEWLINE# #UNINDENT# selection . clear ( ) #NEWLINE# for region in newRegions : #NEWLINE# #INDENT# selection . add ( region )