You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDLE: Format Paragraph doesn't function with comment blocks #62629
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/terryjreedy'closed_at=<Date2013-07-13.04:48:05.418>created_at=<Date2013-07-11.17:56:12.736>labels= ['expert-IDLE', 'type-bug']
title="IDLE: Format Paragraph doesn't function with comment blocks"updated_at=<Date2019-03-25.08:07:34.878>user='https://github.com/rovitotv'
While working on a test case for Format Paragraph (http://bugs.python.org/issue18226) I noted that format paragraph doesn't work with comment blocks when a comment block is selected. The fix is very simple by changing one line:
if first and last:
data = text.get(first, last)
comment_header = get_comment_header(data)
else:
The comment_header line was changed from comment_header = ''. This forces the format paragraph extension to always do "just a normal text format". Attached is a patch but I would like to explore the bug in more detail and make sure all cases are covered.
I expect to find things like this while writing tests. A small fix can be part of the test file commit, like I did with configSectionNameDialog and its test. In any case, where is the test that fails without the patch and passes with it? It should be part of this patch, whether it is included with the test patch or kept separate.
rovitotv commented on Jul 13, 2013
rovitotvmannequin
MannequinAuthor
More actions
Terry,
I was suffering from the classic chicken and egg problem so I was not sure if the test case in http://bugs.python.org/issue18226 should include the small code change. I will work with Phil Webster to get this small change added to bpo-18226 along with test cases. Thanks!
The 'fix', including the test, is included with the patch for bpo-18226. It shares with normal text the problem that selections of partial lines do not work well. I think this might be fixed in bpo-18583 by only re-wrapping complete lines.
Activity
rovitotv commentedon Jul 11, 2013
While working on a test case for Format Paragraph (http://bugs.python.org/issue18226) I noted that format paragraph doesn't work with comment blocks when a comment block is selected. The fix is very simple by changing one line:
if first and last:
data = text.get(first, last)
comment_header = get_comment_header(data)
else:
The comment_header line was changed from comment_header = ''. This forces the format paragraph extension to always do "just a normal text format". Attached is a patch but I would like to explore the bug in more detail and make sure all cases are covered.
terryjreedy commentedon Jul 13, 2013
I expect to find things like this while writing tests. A small fix can be part of the test file commit, like I did with configSectionNameDialog and its test. In any case, where is the test that fails without the patch and passes with it? It should be part of this patch, whether it is included with the test patch or kept separate.
rovitotv commentedon Jul 13, 2013
Terry,
I was suffering from the classic chicken and egg problem so I was not sure if the test case in http://bugs.python.org/issue18226 should include the small code change. I will work with Phil Webster to get this small change added to bpo-18226 along with test cases. Thanks!
python-dev commentedon Aug 10, 2013
New changeset 841984e96df6 by Terry Jan Reedy in branch '2.7':
Issue bpo-18429: Add user-oriented News entry about Format / Format Paragraph
http://hg.python.org/cpython/rev/841984e96df6
New changeset 9eea6401b892 by Terry Jan Reedy in branch '3.3':
Issue bpo-18429: Add user-oriented News entry about Format / Format Paragraph
http://hg.python.org/cpython/rev/9eea6401b892
terryjreedy commentedon Aug 11, 2013
The 'fix', including the test, is included with the patch for bpo-18226. It shares with normal text the problem that selections of partial lines do not work well. I think this might be fixed in bpo-18583 by only re-wrapping complete lines.