
                         N    S r SSKrSSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
r
S rg)zAgcloud interactive specific vi key binding additions / overrides.    N)
IsReadOnly)create_operator_decorator)	InputMode)Keysc                    ^^ [         R                  (       a   [        R                  R	                  S5      nO[        R                  nUS-   m[        U 5      mSUU4S jjnU" S5        U" S5        g)z1Adds gcloud interactive specific vi key bindings.ascii
0123456789Fc                 x   >^  T (       a  S[         R                  S4nOSnT" US[        5       ) 06UU 4S j5       ng)zCreates and registers change operators.

Args:
  with_register: Copy the changed text to this named register instead of
    the clipboard.
"cfilterc                   > SnU R                   nU(       Ga  UR                  UR                  :  a  UR                  UR                  :  a  UR                  UR                  UR                  -   S-
     R                  5       (       am  U=R                  S-  sl        UR                  UR                  :  a>  UR                  UR                  UR                  -   S-
     R                  5       (       a  Mm  OUR                  UR                  :  a  UR                  UR                  UR                  -   S-
     R                  5       (       am  U=R                  S-  sl        UR                  UR                  :  a>  UR                  UR                  UR                  -   S-
     R                  5       (       a  Mm  UR                  U5      u  pBXCl        U(       a  UR                  (       an  T(       aB  U R                  S   R                  nUT;   a"  X R                  R                  R                  U'   O%U R                  R                  R                  U5        [        R                   U R                  R                  l        g)zA change operator.N   )current_bufferstartendtextcursor_positionisspacecutdocumentkey_sequencedataclivi_statenamed_registers	clipboardset_datar   INSERT
input_mode)eventtext_objectclipboard_databufnew_documentreg_namevi_register_nameswith_registers         9lib/googlecloudsdk/command_lib/interactive/bindings_vi.pyChangeOperatorELoadViBindings.<locals>.CreateChangeOperators.<locals>.ChangeOperator4   s     n  c	 {.;#4#44#--%//*,-. //6wy9OOq O ;#4#44#--%//*,-. //6wy9 ""[__4#--%++,./0 118;" ""[__4#--%++,./0 118; (3s';$# 
N//''*//(**;III..x8
))


&
&~
6 '0&6&6eii#    N)r   Anyr   )r(   handler_keysr*   operatorr'   s   `  r)   CreateChangeOperators-LoadViBindings.<locals>.CreateChangeOperators(   s=     488S)ll|2Z\M2 7 3 7r,   TN)F)sixPY2stringascii_lowercasedecoder   )registryr5   r0   r/   r'   s      @@r)   LoadViBindingsr8      s_     	WW,,33G<O,,O%4&x0(-7 -7^ r,   )__doc__r4   prompt_toolkit.filtersr   &prompt_toolkit.key_binding.bindings.vir   #prompt_toolkit.key_binding.vi_stater   prompt_toolkit.keysr   r2   r8    r,   r)   <module>r?      s$     H  - L 9 $ 
;r,   