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 729ec93..cc1b36a 100644
--- a/Tools/idle/FormatParagraph.py
+++ b/Tools/idle/FormatParagraph.py
@@ -14,6 +14,10 @@
keydefs = {
'<<format-paragraph>>': ['<Alt-q>'],
}
+
+ unix_keydefs = {
+ '<<format-paragraph>>': ['<Meta-q>'],
+ }
def __init__(self, editwin):
self.editwin = editwin
@@ -53,7 +57,7 @@
# 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)