Skip to content

Commit 07d5868

Browse files
terryjreedymiss-islington
authored andcommitted
gh-143774 - Improve IDLE Format Paragraph doc (GH-143775)
Add a reminder to not rewrap code line to the Menu => Format => Reformat Paragraph entry. In Editing and Nagivagion, add a new 'Format block' subsection that defines 'paragraph' to better match what is dependably handled as more or less expected. In particular, specify equal indents and that the resulting indent equals original indent. Also mention that selections are expanded to complete lines and how to modify max length. (Also fix a couple case errors in cross references.) (cherry picked from commit fa3abf5) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
1 parent ed5c3ab commit 07d5868

File tree

3 files changed

+38
-12
lines changed

3 files changed

+38
-12
lines changed

Doc/library/idle.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Go to Line
158158

159159
Show Completions
160160
Open a scrollable list allowing selection of existing names. See
161-
:ref:`Completions <completions>` in the Editing and navigation section below.
161+
:ref:`Completions <completions>` in the Editing and Navigation section below.
162162

163163
Expand Word
164164
Expand a prefix you have typed to match a full word in the same window;
@@ -167,7 +167,7 @@ Expand Word
167167
Show Call Tip
168168
After an unclosed parenthesis for a function, open a small window with
169169
function parameter hints. See :ref:`Calltips <calltips>` in the
170-
Editing and navigation section below.
170+
Editing and Navigation section below.
171171

172172
Show Surrounding Parens
173173
Highlight the surrounding parenthesis.
@@ -178,9 +178,9 @@ Format menu (Editor window only)
178178
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179179

180180
Format Paragraph
181-
Reformat the current blank-line-delimited paragraph in comment block or
182-
multiline string or selected line in a string. All lines in the
183-
paragraph will be formatted to less than N columns, where N defaults to 72.
181+
Rewrap the text block containing the text insert cursor.
182+
Avoid code lines. See :ref:`Format block<format-block>` in the
183+
Editing and Navigation section below.
184184

185185
Indent Region
186186
Shift selected lines right by the indent width (default 4 spaces).
@@ -566,6 +566,20 @@ In an editor, import statements have no effect until one runs the file.
566566
One might want to run a file after writing import statements, after
567567
adding function definitions, or after opening an existing file.
568568

569+
.. _format-block:
570+
571+
Format block
572+
^^^^^^^^^^^^
573+
574+
Reformat Paragraph rewraps a block ('paragraph') of contiguous equally
575+
indented non-blank comments, a similar block of text within a multiline
576+
string, or a selected subset of either.
577+
If needed, add a blank line to separate string from code.
578+
Partial lines in a selection expand to complete lines.
579+
The resulting lines have the same indent as before
580+
but have maximum total length of N columns (characters).
581+
Change the default N of 72 on the Window tab of IDLE Settings.
582+
569583
.. _code-context:
570584

571585
Code Context

Lib/idlelib/help.html

Lines changed: 18 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Better explain the operation of Format / Format Paragraph.

0 commit comments

Comments
 (0)