python (3.11.7)
    e                     j    d Z ddlZddlZ G d d          Zedk    rddlmZ  edd	           dS dS )
a=  Complete the current word before the cursor with words in the editor.
Each menu selection or shortcut key selection replaces the word with a
different word with the same prefix. The search for matches begins
before the target and moves toward the top of the editor. It then starts
after the cursor and moves down. It then returns to the original word and
the cycle starts again.
Changing the current text line or leaving the cursor in a different
place before requesting the next selection causes AutoExpand to reset
its state.
There is only one instance of Autoexpand.
    Nc                   J    e Zd Zej        ej        z   dz   Zd Zd Zd Z	d Z
dS )
AutoExpand_c                 N    |j         | _         | j         j        | _        d | _        d S )N)textbellstate)selfeditwins     F/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/idlelib/autoexpand.py__init__zAutoExpand.__init__   s!    L	IN	
    c                    | j                             d          }| j                             dd          }| j        s|                                 }d}n.| j        \  }}}}||k    s||k    r|                                 }d}|s|                                  dS |                                 }| j                             dt          |          z  d           ||         }	|dz   t          |          z  }|dk    r|                                  | j         	                    d|	           | j                             d          }| j                             dd          }||||f| _        dS )z1Replace the current word with the next expansion.insertinsert linestartzinsert lineendr   breakzinsert - %d chars   )
r   indexgetr	   getwordsr   getprevworddeletelenr   )
r
   event	curinsertcurlinewordsr   r   linewordnewwords
             r   expand_word_eventzAutoExpand.expand_word_event   sX   IOOH--	)-- 24DEEz 	MMOOEEE)-&E5&$""dgoo
 	IIKKK7!!	,s4yy8(CCC,c%jj(A::IIKKK	7+++IOOH--	)-- 24DEEE9g5
wr   c                 L   |                                  }|sg S | j                            dd          }t          j        d|z   dz   |          }~| j                            dd          }t          j        d|z   dz   |          }~|s|sg S g }i }|                                 |D ]2}|                    |          r|                    |           |||<