
    fH
                    \   d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	m
Z
 ddlmZ ddlmZ g d	ZeZ ee

      dd       Z ee

      dd       Z ee	
      dd       Z ee	
      dd       Z ee

      dd       Z ee

      dd       Zedd       Z ee
ez  
      dd       Zy)z
Search related key bindings.
    )annotations)search)get_app)	Conditioncontrol_is_searchableis_searching)KeyPressEvent   )key_binding)abort_searchaccept_search start_reverse_incremental_search start_forward_incremental_searchreverse_incremental_searchforward_incremental_searchaccept_search_and_accept_input)filterc                ,    t        j                          y)zr
    Abort an incremental search and restore the original
    line.
    (Usually bound to ControlG/ControlC.)
    N)r   stop_searchevents    e/var/www/cvtools/html/venv/lib/python3.12/site-packages/prompt_toolkit/key_binding/bindings/search.pyr   r      s         c                ,    t        j                          y)z
    When enter pressed in isearch, quit isearch mode. (Multiline
    isearch would be too complicated.)
    (Usually bound to Enter.)
    N)r   r   r   s    r   r   r   %   s     r   c                `    t        j                  t         j                  j                         y)zC
    Enter reverse incremental search.
    (Usually ControlR.)
    	directionN)r   start_searchSearchDirectionBACKWARDr   s    r   r   r   /   s     &"8"8"A"ABr   c                `    t        j                  t         j                  j                         y)zC
    Enter forward incremental search.
    (Usually ControlS.)
    r   N)r   r   r   FORWARDr   s    r   r   r   8   s     &"8"8"@"@Ar   c                v    t        j                  t         j                  j                  | j                         y)zK
    Apply reverse incremental search, but keep search buffer focused.
    countN)r   do_incremental_searchr   r    argr   s    r   r   r   A   s$    
   !7!7!@!@		Rr   c                v    t        j                  t         j                  j                  | j                         y)zK
    Apply forward incremental search, but keep search buffer focused.
    r$   N)r   r&   r   r"   r'   r   s    r   r   r   I   s$    
   !7!7!?!?uyyQr   c                     t               j                  j                  } t        | xr | j                  j
                        S )zE
    True if the previously focused buffer has a return handler.
    )r   layoutsearch_target_buffer_controlboolbufferis_returnable)prev_controls    r   _previous_buffer_is_returnabler0   Q   s3    
 9##@@LB!4!4!B!BCCr   c                `    t        j                          | j                  j                          y)zC
    Accept the search operation first, then accept the input.
    N)r   r   current_buffervalidate_and_handler   s    r   r   r   Z   s"    
 	,,.r   N)r   EreturnNone)r5   r,   )__doc__
__future__r   prompt_toolkitr   "prompt_toolkit.application.currentr   prompt_toolkit.filtersr   r   r   (prompt_toolkit.key_binding.key_processorr	   key_bindingsr   __all__r4   r   r   r   r   r   r   r0   r    r   r   <module>r@      s   # ! 6 Q Q B &  L! " L! " )*C +C )*B +B L!S "S L!R "R D D L#AAB/ C/r   