From 43476e009b2f3b9fd6c3d600bb41a0298907bad5 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Thu, 20 Jul 2006 22:22:52 +0000 Subject: Avoid occasional failure to detect closing paren properly. Patch 1407280 Tal Einat M ParenMatch.py M NEWS.txt M CREDITS.txt --- Lib/idlelib/CREDITS.txt | 15 ++++++++------- Lib/idlelib/NEWS.txt | 3 +++ Lib/idlelib/ParenMatch.py | 7 ++++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Lib/idlelib/CREDITS.txt b/Lib/idlelib/CREDITS.txt index 6f4e95d..d524405 100644 --- a/Lib/idlelib/CREDITS.txt +++ b/Lib/idlelib/CREDITS.txt @@ -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! diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index fb77e13..4dc2505 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -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 # correctly, also unicode strings and diff --git a/Lib/idlelib/ParenMatch.py b/Lib/idlelib/ParenMatch.py index 673aee2..250ae8b 100644 --- a/Lib/idlelib/ParenMatch.py +++ b/Lib/idlelib/ParenMatch.py @@ -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 -- cgit v0.12