(format_line)
return apply
Apply a formatting function to all of the selected lines.
Apply a formatting function to all of the selected lines.
Apply a formatting function to all of the selected lines .
def format_selection(format_line):
    "Apply a formatting function to all of the selected lines."

    @wraps(format_line)
    def apply(self, event=None):
        head, tail, chars, lines = self.formatter.get_region()
        for pos in range(len(lines) - 1):
            line = lines[pos]
            lines[pos] = format_line(self, line)
        self.formatter.set_region(head, tail, chars, lines)
        return 'break'

    return apply
def format_selection ( format_line ) : @ wraps ( format_line ) def apply ( self , event = None ) : head , tail , chars , lines = self . formatter . get_region ( ) for pos in range ( len ( lines ) - 1 ) : line = lines [ pos ] lines [ pos ] = format_line ( self , line ) self . formatter . set_region ( head , tail , chars , lines ) return 'break' return apply