Hacked By AnonymousFox
3
� f$ � @ sf d Z ddlmZ ddlmZ dddd�ZdZG d d
� d
�Zej� e dkrbddl
mZ ed
dd� dS )z�ParenMatch -- for parenthesis matching.
When you hit a right paren, the cursor should move briefly to the left
paren. Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
� )�HyperParser)�idleConf�(�[�{)�)�]�}�d c @ s� e Zd ZdZdZd%Zdd� Zed d
� �Zdd� Z d
d� Z
dd� Zdd� Zdd� Z
d&dd�Zdd� Zdd� Zdd� Zdd� Zeeeed �Zd!d"� Zd#d$� ZdS )'�
ParenMatcha' Highlight matching openers and closers, (), [], and {}.
There are three supported styles of paren matching. When a right
paren (opener) is typed:
opener -- highlight the matching left paren (closer);
parens -- highlight the left and right parens (opener and closer);
expression -- highlight the entire expression from opener to closer.
(For back compatibility, 'default' is a synonym for 'opener').
Flash-delay is the maximum milliseconds the highlighting remains.
Any cursor movement (key press or click) before that removes the
highlight. If flash-delay is 0, there is no maximum.
TODO:
- Augment bell() with mismatch warning in status window.
- Highlight when cursor is moved to the right of a closer.
This might be too expensive to check.
z<<parenmatch-check-restore>>�
<KeyPress>�
<ButtonPress>�<Key-Return>�<Key-BackSpace>c C s0 || _ |j| _|jj| j| j� d| _d| _d S )Nr )�editwin�textZbind�RESTORE_VIRTUAL_EVENT_NAME�
restore_event�counter�is_restore_active)�selfr � r �7/opt/alt/python36/lib64/python3.6/idlelib/parenmatch.py�__init__( s
zParenMatch.__init__c C sV t jddddd�| _t jdddddd �| _t jddd
ddd �| _t jt j� d
�| _d S )N�
extensionsr Zstyle�opener)�defaultzflash-delay�inti� )�typer �bell�bool� Zhilite)r Z GetOption�STYLE�FLASH_DELAY�BELLZGetHighlightZCurrentTheme�
HILITE_CONFIG)�clsr r r �reload3 s
zParenMatch.reloadc C s0 | j s,x| jD ]}| jj| j|� qW d| _ dS )z5Activate mechanism to restore text from highlighting.TN)r �RESTORE_SEQUENCESr Z event_addr )r �seqr r r �activate_restore>