From: Guido van Rossum Date: Mon, 4 Jan 1999 16:34:41 +0000 (+0000) Subject: Added Unix Meta-q key binding; X-Git-Tag: v1.5.2b2~471 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e911c3e20cfa324e95f49d033cfe636543cce8cb;p=thirdparty%2FPython%2Fcpython.git Added Unix Meta-q key binding; fix find_paragraph when at start of file. --- diff --git a/Tools/idle/FormatParagraph.py b/Tools/idle/FormatParagraph.py index 729ec93ec47e..cc1b36a6e72c 100644 --- a/Tools/idle/FormatParagraph.py +++ b/Tools/idle/FormatParagraph.py @@ -14,6 +14,10 @@ class FormatParagraph: keydefs = { '<>': [''], } + + unix_keydefs = { + '<>': [''], + } def __init__(self, editwin): self.editwin = editwin @@ -53,7 +57,7 @@ def find_paragraph(text, mark): # Search back to beginning of paragraph lineno = first_lineno - 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) - while not is_all_white(line): + while lineno > 0 and not is_all_white(line): lineno = lineno - 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) first = "%d.0" % (lineno+1)