#NEWLINE# def run( self , edit ) : #NEWLINE# #INDENT# folds = [ ] #NEWLINE# tp = 0 #NEWLINE# size = self . view . size ( ) #NEWLINE# while ( tp < size ) : #NEWLINE# #INDENT# s = self . view . indented_region ( s ) #NEWLINE# if ( not s . empty ( ) ) : #NEWLINE# #INDENT# r = fold_region_from_indent ( self . view , s ) #NEWLINE# folds . append ( r ) #NEWLINE# tp = s . b #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# tp = self . view . full_line ( tp ) . b #NEWLINE# #UNINDENT# #UNINDENT# self . view . fold ( folds ) #NEWLINE# self . view . show ( self . view . sel ( ) ) #NEWLINE# sublime . status_message ( ( ( 'Folded ' + str ( len ( folds ) ) ) + ' regions' ) )