format_paragraph_event(): Patch 961387 introduced a bug here, causing

the indentation of a comment block to be ignored when reformatting the
block, leading to overly long reformatted lines (too wide by an amount
equal to the indentation width).  Looks like a typo in the original
patch, a 1-character repair.
This commit is contained in:
Tim Peters 2004-10-24 23:45:42 +00:00
parent 2ef7e6c8f2
commit 16e3cf535b
2 changed files with 24 additions and 13 deletions

View File

@ -47,7 +47,7 @@ class FormatParagraph:
lines = map(lambda st, l=len(comment_header): st[l:], lines) lines = map(lambda st, l=len(comment_header): st[l:], lines)
data = "\n".join(lines) data = "\n".join(lines)
# Reformat to maxformatwidth chars or a 20 char width, whichever is greater. # Reformat to maxformatwidth chars or a 20 char width, whichever is greater.
format_width = max(maxformatwidth, len(comment_header), 20) format_width = max(maxformatwidth - len(comment_header), 20)
newdata = reformat_paragraph(data, format_width) newdata = reformat_paragraph(data, format_width)
# re-split and re-insert the comment header. # re-split and re-insert the comment header.
newdata = newdata.split("\n") newdata = newdata.split("\n")

View File

@ -1,3 +1,14 @@
What's New in IDLE 1.1b2?
=========================
*Release date: DD-MMM-2004*
- When paragraph reformat width was made configurable, a bug was
introduced that caused reformatting of comment blocks to ignore how
far the block was indented, effectively adding the indentation width
to the reformat width. This has been repaired, and the reformat
width is again a bound on the total width of reformatted lines.
What's New in IDLE 1.1b1? What's New in IDLE 1.1b1?
========================= =========================