diff options
author | Guido van Rossum <guido@python.org> | 1999-01-04 16:34:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-01-04 16:34:41 (GMT) |
commit | e911c3e20cfa324e95f49d033cfe636543cce8cb (patch) | |
tree | fbf40c70ff48c9a87a341d73adbc4500ac925052 | |
parent | 16b91f89b5afc450736861dd92e4638fe52eaeeb (diff) | |
download | cpython-e911c3e20cfa324e95f49d033cfe636543cce8cb.zip cpython-e911c3e20cfa324e95f49d033cfe636543cce8cb.tar.gz cpython-e911c3e20cfa324e95f49d033cfe636543cce8cb.tar.bz2 |
Added Unix Meta-q key binding;
fix find_paragraph when at start of file.
-rw-r--r-- | Tools/idle/FormatParagraph.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 = { '<<format-paragraph>>': ['<Alt-q>'], } + + unix_keydefs = { + '<<format-paragraph>>': ['<Meta-q>'], + } 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) |