Skip to content

IDLE: Format Paragraph doesn't function with comment blocks #62629

Closed

Description

@rovitotv
mannequin
BPO 18429
Nosy @terryjreedy, @serwy, @rovitotv
Files
  • 18429FormatParagraphFor3.4.patch
  • 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 = <Date 2013-07-13.04:48:05.418>
    created_at = <Date 2013-07-11.17:56:12.736>
    labels = ['expert-IDLE', 'type-bug']
    title = "IDLE: Format Paragraph doesn't function with comment blocks"
    updated_at = <Date 2019-03-25.08:07:34.878>
    user = 'https://github.com/rovitotv'

    bugs.python.org fields:

    activity = <Date 2019-03-25.08:07:34.878>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2013-07-13.04:48:05.418>
    closer = 'Todd.Rovito'
    components = ['IDLE']
    creation = <Date 2013-07-11.17:56:12.736>
    creator = 'Todd.Rovito'
    dependencies = []
    files = ['30891']
    hgrepos = []
    issue_num = 18429
    keywords = ['patch']
    message_count = 5.0
    messages = ['192883', '192985', '192997', '194839', '194861']
    nosy_count = 6.0
    nosy_names = ['terry.reedy', 'roger.serwy', 'Todd.Rovito', 'python-dev', 'JayKrish', 'philwebster']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue18429'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    Activity

    1. rovitotv commented on Jul 11, 2013

      rovitotvmannequin
      MannequinAuthor

      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.

    2. added
      type-bug
      on Jul 11, 2013
    3. terryjreedy commented on Jul 13, 2013

      @terryjreedy
      Member

      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.

    4. rovitotv commented on Jul 13, 2013

      rovitotvmannequin
      MannequinAuthor

      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!

    5. python-dev commented on Aug 10, 2013

      python-devmannequin
      Mannequin

      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

    6. terryjreedy commented on Aug 11, 2013

      @terryjreedy
      Member

      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.

    7. self-assigned this
      on Mar 25, 2019
    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    topic-IDLEtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions