Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
88b0750e
Commit
88b0750e
authored
Jan 04, 1999
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Unix Meta-q key binding;
fix find_paragraph when at start of file.
parent
3ebbf116
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
Tools/idle/FormatParagraph.py
Tools/idle/FormatParagraph.py
+5
-1
No files found.
Tools/idle/FormatParagraph.py
View file @
88b0750e
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment