Skip to content

Commit 746d2f9

Browse files
[3.13] gh-143774 - Improve IDLE Format Paragraph doc (GH-143775) (#144063)
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 c779fa2 commit 746d2f9

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
@@ -159,7 +159,7 @@ Go to Line
159159

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

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

173173
Show Surrounding Parens
174174
Highlight the surrounding parenthesis.
@@ -179,9 +179,9 @@ Format menu (Editor window only)
179179
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
180180

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

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

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

572586
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)