Menu

#408 Add dosctring wrapping to Format code

open
nobody
None
5
2009-12-15
2009-12-15
pachiburke
No

Python Format Code could grow line wrapping support for docstring wo, when moving a function around, to a different nesting level, the docstring gets reformatted respecting the line length limit and it's word wrapped (ala gq in GVIM).

Discussion

  • Jari Pennanen

    Jari Pennanen - 2010-01-06

    Also wrapping multi-line normal comments same way would be more than useful, by multi-line comments I mean of course:

    # Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eu
    # nunc urna. Sed massa ipsum, hendrerit vel varius vitae, iaculis
    # vel eros. Maecenas vel ligula ut erat sagittis vestibulum vel ac
    # metus. Vestibulum dapibus augue ut lectus tincidunt sollicitudin.
    #
    # Phasellus tincidunt quam et neque consectetur ut tristique lectus
    # eleifend. Nam condimentum odio quis orci pretium malesuada. Duis
    # augue odio, interdum sit amet tincidunt in, blandit eu tortor.

    I suppose Eclipse could implement this, but as we know, they have a long feud about wrapping and that is not going to happen for a while.

    Thus I also think PyDev should help at least Python developers, and lead the way for others too at the same time!

     
  • Jari Pennanen

    Jari Pennanen - 2010-01-06

    I also note, that it is extremely painful to *edit* the multi-line comments / docstrings currently. Especially when one adds or replaces words, which almost always leads to going through all subsequent lines and fixing the wrapping by hand. Ouch.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-01-06

    Note that you can already use Ctrl+2+w to make the wrapping correct in comments (although that's not currently applied automatically in the code formatting)

     
  • Jari Pennanen

    Jari Pennanen - 2010-01-06

    I must wonder why is this not found under menu "Source"? Thats where I have been looking for it for no avail for a long time.

    I'm glad that this feature is here, now that I found it... I'm embarrassed to say I have been doing this work by hand for a long time with PyDev.

     
  • pachiburke

    pachiburke - 2010-01-06

    Great to know that the feature is already done, but I would also love having it listed under the "Source" menu, as of now it is, IMHO, almost undiscoverable.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-01-07

    Added it to the source menu for 1.5.4

     
  • pachiburke

    pachiburke - 2010-01-07

    Thanks a lot, Fabio.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.