mò &U²Ic@sZdkZdklZdfd„ƒYZd„Zd„Zd„Zd„Zd„ZdS( N(sidleConftFormatParagraphcBs5tZddgfgZd„Zd„Zd„ZRS(NtformatsFormat Paragraphs<>cCs ||_dS(N(teditwintself(RR((t4/data/zmath/lib/python2.4/idlelib/FormatParagraph.pyt__init__scCs d|_dS(N(tNoneRR(R((Rtclosesc Csêttidddƒƒ} |ii}|iiƒ\} }| o#|o|i | |ƒ} d} n%t ||idƒƒ\} }} } | oÁ| idƒ}tt| ƒd„|ƒ}di|ƒ} t| t| ƒdƒ}t| |ƒ}|idƒ}d}|d pd}|d }n| d „}dit||ƒƒ|}nt| | ƒ}|id d d ƒ|| joH|id| ƒ|iƒ|i| |ƒ|i| |ƒ|iƒn|id|ƒ|i dƒdS(NtmainRt paragraphttinserts cCs||S(N(tsttl(R R ((Rt/siiÿÿÿÿcCs||S(N(tprefixtitem(RR((RR?stsels1.0tend(!tinttidleConft GetOptiontmaxformatwidthRRttexttget_selection_indicestfirsttlasttgettdatatcomment_headertfind_paragraphtindextsplittlinestmaptlentjointmaxt format_widthtreformat_paragraphtnewdatat block_suffixtbuildert tag_removetmark_settundo_block_starttdeleteR tundo_block_stoptsee( RteventRR&R*RR)R!R(RRRR((Rtformat_paragraph_event"s<  $     (sFormat Paragraphs<>(t__name__t __module__tmenudefsRRR2(((RRs  c Cs°tt|idƒƒ\}}|id|d|ƒ}xP|i d|ddƒo5t |ƒo(|d}|id|d|ƒ}q;W|}t |ƒ}t|ƒ} xNt |ƒ|jo:t || ƒ o(|d}|id|d|ƒ}q¬Wd|}|d}|id|d|ƒ}x[|djoMt |ƒ|jo:t || ƒ o(|d}|id|d|ƒ}q+Wd|d}||||i||ƒfS(Nt.s%d.0s %d.0 lineendtRR9R;RR:R@((RROs,'   %   2 c Cs |idƒ}d}t|ƒ}x-||jot||ƒo|d}q$W||jo|Snt||ƒ}|d|jo.t||dƒ ot||dƒ} n|} || } |}x||jot||ƒ oît id||ƒ} xÇtdt| ƒdƒD]­}| |}|pqnt||iƒƒ|jo*||jo| i|iƒƒ| }n||d}|dt| ƒjo#| |ddjo|d}qqW|d}qÎW| i|iƒƒ| i||ƒdi| ƒS(Ns iis(\s+)it (RR R!tiR#tnR=t get_indenttindent1tindent2tnewtpartialtretwordstrangetjtwordt expandtabstlimittappendtrstriptextendR$( RRORHRBRMRLR!RCRERFRJRG((RR'hs@  '  * ,cCstid|ƒdj S(Ns^\s*$(RItmatchR;R(R;((RR=‹scCstid|ƒiƒS(Ns^(\s*)(RIRSR;tgroup(R;((RRDŽscCs4tid|ƒ}|djodSn|idƒS(Ns^(\s*#*)R i(RIRSR;tmRRT(R;RU((RR?‘s ( RIt configHandlerRRRR'R=RDR?(RRDR?R'RRIRR=((Rt?s  ;  #