classification
Title: IDLE: Format Paragraph doesn't function with comment blocks
Type: behavior Stage: test needed
Components: Versions: Python 3.4, Python 3.3, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: JayKrish, Todd.Rovito, philwebster, python-dev, roger.serwy, terry.reedy
Priority: normal Keywords: patch

Created on 2013-07-11 17:56 by Todd.Rovito, last changed 2013-08-11 03:09 by terry.reedy. This issue is now closed.

Files
File name Uploaded Description Edit
18429FormatParagraphFor3.4.patch Todd.Rovito, 2013-07-11 17:59 review
Messages (5)
msg192883 - (view) Author: Todd Rovito (Todd.Rovito) * Date: 2013-07-11 17:56
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.
msg192985 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-07-13 00:54
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.
msg192997 - (view) Author: Todd Rovito (Todd.Rovito) * Date: 2013-07-13 04:48
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 issue 18226 along with test cases.  Thanks!
msg194839 - (view) Author: Roundup Robot (python-dev) Date: 2013-08-10 21:47
New changeset 841984e96df6 by Terry Jan Reedy in branch '2.7':
Issue #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 #18429: Add user-oriented News entry about Format / Format Paragraph
http://hg.python.org/cpython/rev/9eea6401b892
msg194861 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-08-11 03:09
The 'fix', including the test, is included with the patch for #18226.  It shares with normal text the problem that selections of partial lines do not work well. I think this might be fixed in #18583 by only re-wrapping complete lines.
History
Date User Action Args
2013-08-11 03:09:54terry.reedysetmessages: + msg194861
2013-08-10 21:47:11python-devsetnosy: + python-dev
messages: + msg194839
2013-07-13 04:48:05Todd.Rovitosetstatus: open -> closed
resolution: duplicate
messages: + msg192997
2013-07-13 00:54:19terry.reedysetstage: test needed
messages: + msg192985
versions: + Python 2.7, Python 3.3
2013-07-11 17:59:07Todd.Rovitosetfiles: + 18429FormatParagraphFor3.4.patch
nosy: + terry.reedy, roger.serwy, JayKrish, philwebster
keywords: + patch
2013-07-11 17:56:12Todd.Rovitocreate