B
     S]d                 @   s6   d Z G dd dZedkr2ddlmZ eddd d	S )
z=Provides "Strip trailing whitespace" under the "Format" menu.c               @   s   e Zd Zdd ZdddZdS )Rstripc             C   s
   || _ d S )N)editwin)selfr    r   lib/python3.7/idlelib/rstrip.py__init__   s    zRstrip.__init__Nc       	      C   s   | j j}| j j}|  tt|d}xZtd|D ]L}|d| d| }t	|}t	|
 }||k r6|d||f d|  q6W |  d S )Nend   z%i.0z%i.endz%i.%i)r   textundoZundo_block_startintfloatindexrangegetlenrstripdeleteZundo_block_stop)	r   Zeventr	   r
   Zend_lineZcurZtxtrawZcutr   r   r   	do_rstrip   s    zRstrip.do_rstrip)N)__name__
__module____qualname__r   r   r   r   r   r   r      s   r   __main__    )mainzidlelib.idle_test.test_rstrip   )	verbosityN)__doc__r   r   Zunittestr   r   r   r   r   <module>   s   