(self, event, limit=None)
return "break"
Formats paragraph to a max width specified in idleConf.

        If text is selected, format_paragraph_event will start breaking lines
        at the max width, starting from the beginning selection.

        If no text is selected, format_paragraph_event uses the current
        cursor location to determine the paragraph (lines of text surrounded
        by blank lines) and formats it.

        The length limit parameter is for testing with a known value.
Formats paragraph to a max width specified in idleConf.
Formats paragraph to a max width specified in idleConf .
def format_paragraph_event(self, event, limit=None):
        """Formats paragraph to a max width specified in idleConf.

        If text is selected, format_paragraph_event will start breaking lines
        at the max width, starting from the beginning selection.

        If no text is selected, format_paragraph_event uses the current
        cursor location to determine the paragraph (lines of text surrounded
        by blank lines) and formats it.

        The length limit parameter is for testing with a known value.
        """
        limit = self.max_width if limit is None else limit
        text = self.editwin.text
        first, last = self.editwin.get_selection_indices()
        if first and last:
            data = text.get(first, last)
            comment_header = get_comment_header(data)
        else:
            first, last, comment_header, data = \
                    find_paragraph(text, text.index("insert"))
        if comment_header:
            newdata = reformat_comment(data, limit, comment_header)
        else:
            newdata = reformat_paragraph(data, limit)
        text.tag_remove("sel", "1.0", "end")

        if newdata != data:
            text.mark_set("insert", first)
            text.undo_block_start()
            text.delete(first, last)
            text.insert(first, newdata)
            text.undo_block_stop()
        else:
            text.mark_set("insert", last)
        text.see("insert")
        return "break"
def format_paragraph_event ( self , event , limit = None ) : limit = self . max_width if limit is None else limit text = self . editwin . text first , last = self . editwin . get_selection_indices ( ) if first and last : data = text . get ( first , last ) comment_header = get_comment_header ( data ) else : first , last , comment_header , data = find_paragraph ( text , text . index ( "insert" ) ) if comment_header : newdata = reformat_comment ( data , limit , comment_header ) else : newdata = reformat_paragraph ( data , limit ) text . tag_remove ( "sel" , "1.0" , "end" ) if newdata != data : text . mark_set ( "insert" , first ) text . undo_block_start ( ) text . delete ( first , last ) text . insert ( first , newdata ) text . undo_block_stop ( ) else : text . mark_set ( "insert" , last ) text . see ( "insert" ) return "break"