Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1547 Code formatter causes problems with commented code blocks

open
Editor (491)
5
2013-04-03
2012-12-25
Shi Sherebrin
No

I sometimes use the PyDev feature "Python Toggle Comment" (Ctrl+/) on a block of code. When the setting "Spaces in comment start" is set to "at least one space" this causes problems when I toggle off the comments (if I've saved the file in the interim), since the space added by the formatter is not removed and now my code is at an illegal indent level. Not sure what to suggest - perhaps have the toggle comment feature insert/remove as many space as the current formatter setting? Some corner cases will probably need to be considered, or perhaps there's another better approach that isn't occurring to me?

Discussion

  • Shi Sherebrin
    Shi Sherebrin
    2012-12-25

    Clarification: this only applies when the indent-level of the code block in question is zero.

     
  • pavel
    pavel
    2013-04-03

    See this issue in PyDev 2.7.3.2013031601.
    Also on each comment\uncomment with Ctrl+/ one space is being added to empty stings.