From e911c3e20cfa324e95f49d033cfe636543cce8cb Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 4 Jan 1999 16:34:41 +0000 Subject: Added Unix Meta-q key binding; fix find_paragraph when at start of file. --- Tools/idle/FormatParagraph.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tools/idle/FormatParagraph.py b/Tools/idle/FormatParagraph.py index 729ec93..cc1b36a 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) -- cgit v0.12