#NEWLINE# def run( self , edit , user_input = None , mode = False , live_preview = False ) : #NEWLINE# #INDENT# view = self . view #NEWLINE# if ( not user_input ) : #NEWLINE# #INDENT# self . aligned = False #NEWLINE# v = self . view . window ( ) . show_input_panel ( 'Align By RegEx:' , '' , ( lambda x : self . on_done ( x , mode , live_preview ) ) , ( lambda x : ( self . on_change ( x ) if live_preview else None ) ) , ( lambda : ( self . on_change ( None ) if live_preview else None ) ) ) #NEWLINE# v . settings ( ) . set ( 'AlignTabInputPanel' , True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# user_input = resolve_input ( user_input ) #NEWLINE# error = [ ] #NEWLINE# for uinput in user_input : #NEWLINE# #INDENT# aligner = Aligner ( view , uinput , mode ) #NEWLINE# self . aligned = aligner . run ( edit ) #NEWLINE# if self . aligned : #NEWLINE# #INDENT# if mode : #NEWLINE# #INDENT# toogle_table_mode ( view , True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sublime . status_message ( '' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( mode and ( not aligner . adjacent_lines_match ( ) ) ) : #NEWLINE# #INDENT# toogle_table_mode ( view , False ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# error . append ( uinput ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if error : #NEWLINE# #INDENT# errors = '    ' . join ( error ) #NEWLINE# sublime . status_message ( ( ( '[Patterns not Found:   ' + errors ) + '   ]' ) )