Commit d79c976d authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

Avoid occasional failure to detect closing paren properly.

Patch 1407280 Tal Einat

M    ParenMatch.py
M    NEWS.txt
M    CREDITS.txt
parent 6dd0f0ab
...@@ -19,17 +19,18 @@ the integration of the RPC and remote debugger, implemented the threaded ...@@ -19,17 +19,18 @@ the integration of the RPC and remote debugger, implemented the threaded
subprocess, and made a number of usability enhancements. subprocess, and made a number of usability enhancements.
Other contributors include Raymond Hettinger, Tony Lownds (Mac integration), Other contributors include Raymond Hettinger, Tony Lownds (Mac integration),
Neal Norwitz (code check and clean-up), and Chui Tey (RPC integration, debugger Neal Norwitz (code check and clean-up), Noam Raphael (Code Context, Call Tips,
integration and persistent breakpoints). many other patches), and Chui Tey (RPC integration, debugger integration and
persistent breakpoints).
Scott David Daniels, Hernan Foffani, Christos Georgiou, Martin v. Löwis, Scott David Daniels, Tal Einat, Hernan Foffani, Christos Georgiou,
Jason Orendorff, Noam Raphael, Josh Robb, Nigel Rowe, Bruce Sherwood, and Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, Bruce Sherwood,
Jeff Shute have submitted useful patches. Thanks, guys! and Jeff Shute have submitted useful patches. Thanks, guys!
For additional details refer to NEWS.txt and Changelog. For additional details refer to NEWS.txt and Changelog.
Please contact the IDLE maintainer to have yourself included here if you Please contact the IDLE maintainer (kbk@shore.net) to have yourself included
are one of those we missed! here if you are one of those we missed!
...@@ -3,6 +3,9 @@ What's New in IDLE 1.2c1? ...@@ -3,6 +3,9 @@ What's New in IDLE 1.2c1?
*Release date: XX-XXX-2006* *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. - Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168.
- Colorizer now handles #<builtin> correctly, also unicode strings and - Colorizer now handles #<builtin> correctly, also unicode strings and
......
...@@ -8,7 +8,7 @@ parentheses, square brackets, and curly braces. ...@@ -8,7 +8,7 @@ parentheses, square brackets, and curly braces.
from HyperParser import HyperParser from HyperParser import HyperParser
from configHandler import idleConf from configHandler import idleConf
keysym_opener = {"parenright":'(', "bracketright":'[', "braceright":'{'} _openers = {')':'(',']':'[','}':'{'}
CHECK_DELAY = 100 # miliseconds CHECK_DELAY = 100 # miliseconds
class ParenMatch: class ParenMatch:
...@@ -100,12 +100,13 @@ class ParenMatch: ...@@ -100,12 +100,13 @@ class ParenMatch:
def paren_closed_event(self, event): def paren_closed_event(self, event):
# If it was a shortcut and not really a closing paren, quit. # 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 return
hp = HyperParser(self.editwin, "insert-1c") hp = HyperParser(self.editwin, "insert-1c")
if not hp.is_in_code(): if not hp.is_in_code():
return return
indices = hp.get_surrounding_brackets(keysym_opener[event.keysym], True) indices = hp.get_surrounding_brackets(_openers[closer], True)
if indices is None: if indices is None:
self.warn_mismatched() self.warn_mismatched()
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment