Avoid occasional failure to detect closing paren properly.

Patch 1407280 Tal Einat

M    ParenMatch.py
M    NEWS.txt
M    CREDITS.txt
This commit is contained in:
Kurt B. Kaiser 2006-07-20 22:22:52 +00:00
parent 3fda93604c
commit 43476e009b
3 changed files with 15 additions and 10 deletions

View File

@ -19,17 +19,18 @@ the integration of the RPC and remote debugger, implemented the threaded
subprocess, and made a number of usability enhancements.
Other contributors include Raymond Hettinger, Tony Lownds (Mac integration),
Neal Norwitz (code check and clean-up), and Chui Tey (RPC integration, debugger
integration and persistent breakpoints).
Neal Norwitz (code check and clean-up), Noam Raphael (Code Context, Call Tips,
many other patches), and Chui Tey (RPC integration, debugger integration and
persistent breakpoints).
Scott David Daniels, Hernan Foffani, Christos Georgiou, Martin v. Löwis,
Jason Orendorff, Noam Raphael, Josh Robb, Nigel Rowe, Bruce Sherwood, and
Jeff Shute have submitted useful patches. Thanks, guys!
Scott David Daniels, Tal Einat, Hernan Foffani, Christos Georgiou,
Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, Bruce Sherwood,
and Jeff Shute have submitted useful patches. Thanks, guys!
For additional details refer to NEWS.txt and Changelog.
Please contact the IDLE maintainer to have yourself included here if you
are one of those we missed!
Please contact the IDLE maintainer (kbk@shore.net) to have yourself included
here if you are one of those we missed!

View File

@ -3,6 +3,9 @@ What's New in IDLE 1.2c1?
*Release date: XX-XXX-2006*
- Avoid occasional failure to detect closing paren properly.
Patch 1407280 Tal Einat
- Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168.
- Colorizer now handles #<builtin> correctly, also unicode strings and

View File

@ -8,7 +8,7 @@ parentheses, square brackets, and curly braces.
from HyperParser import HyperParser
from configHandler import idleConf
keysym_opener = {"parenright":'(', "bracketright":'[', "braceright":'{'}
_openers = {')':'(',']':'[','}':'{'}
CHECK_DELAY = 100 # miliseconds
class ParenMatch:
@ -100,12 +100,13 @@ class ParenMatch:
def paren_closed_event(self, event):
# If it was a shortcut and not really a closing paren, quit.
if self.text.get("insert-1c") not in (')',']','}'):
closer = self.text.get("insert-1c")
if closer not in _openers:
return
hp = HyperParser(self.editwin, "insert-1c")
if not hp.is_in_code():
return
indices = hp.get_surrounding_brackets(keysym_opener[event.keysym], True)
indices = hp.get_surrounding_brackets(_openers[closer], True)
if indices is None:
self.warn_mismatched()
return