#NEWLINE# def run( self , edit , forward = True ) : #NEWLINE# #INDENT# new_sel = [ ] #NEWLINE# for r in self . view . sel ( ) : #NEWLINE# #INDENT# point = r . a #NEWLINE# for i in self . view . folded_regions ( ) : #NEWLINE# #INDENT# if i . contains ( sublime . Region ( point , point ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# t = table . convert_table_at_point_as_list ( self . view , point ) #NEWLINE# t = table . reformat_table_list ( t ) #NEWLINE# t_str = table . convert_table_list_to_str ( t ) #NEWLINE# ( cur_row_num , cur_col_num ) = table . get_point_row_and_col ( self . view , point ) #NEWLINE# table_row_num = len ( start_line_num ) #NEWLINE# ( line_num , _ ) = self . view . rowcol ( point ) #NEWLINE# start_line_num = ( line_num - cur_row_num ) #NEWLINE# start_point = self . view . text_point ( ( line_num - cur_row_num ) , 0 ) #NEWLINE# end_line_num = ( ( ( line_num + table_row_num ) - cur_row_num ) - 1 ) #NEWLINE# end_line_start_point = self . view . text_point ( end_line_num , 0 ) #NEWLINE# end_point = self . view . line ( end_line_start_point ) . b #NEWLINE# self . view . erase ( edit , sublime . Region ( start_point , end_point ) ) #NEWLINE# self . view . insert ( edit , start_point , t_str ) #NEWLINE# if forward : #NEWLINE# #INDENT# if ( ( cur_col_num is None ) or ( cur_col_num >= ( len ( t [ 0 ] ) - 1 ) ) ) : #NEWLINE# #INDENT# line_num += 1 #NEWLINE# while table . is_line_separator ( self . view , line_num ) : #NEWLINE# #INDENT# line_num += 1 #NEWLINE# #UNINDENT# cur_col_num = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cur_col_num += 1 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( cur_col_num is None ) or ( cur_col_num <= 0 ) ) : #NEWLINE# #INDENT# line_num -= 1 #NEWLINE# while table . is_line_separator ( self . view , line_num ) : #NEWLINE# #INDENT# line_num -= 1 #NEWLINE# #UNINDENT# cur_col_num = ( len ( t [ 0 ] ) - 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cur_col_num -= 1 #NEWLINE# #UNINDENT# #UNINDENT# if ( ( line_num < start_line_num ) or ( line_num > end_line_num ) ) : #NEWLINE# #INDENT# col_pos = 0 #NEWLINE# if ( line_num > end_line_num ) : #NEWLINE# #INDENT# self . view . insert ( edit , self . view . text_point ( line_num , 0 ) , '\n' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# col_pos = self . calculate_col_point ( t , cur_col_num ) #NEWLINE# #UNINDENT# new_sel . append ( self . view . text_point ( line_num , col_pos ) ) #NEWLINE# #UNINDENT# self . view . sel ( ) . clear ( ) #NEWLINE# for r in new_sel : #NEWLINE# #INDENT# self . view . sel ( ) . add ( r ) #NEWLINE# self . view . show ( r )