Comment left align



  • Is there a setting , so that the comment is like

          code 
    //    code
    

    instead of

           code
           // code
    

    ?



  • @Jürgen-Nießen ,

    Sorry, auto-indent keeps comments at the same level of indentation as the code block the comment is a part of (because the auto-indentation is a feature coded at the editor level, whereas the marking of “comment” is coded at the lexer/syntax-highlighter level).

    That said, alternatives include:

    • running code through an external “pretty print” utility – @Michael-Vincent gives examples of how to do that in an old post <edit>: in this old post (which was linked from the other; sorry.)</edit>
    • using one of the scripting plugins (like PythonScript) to set up a hook to watch what you type, and if you type the comment indicator on a line that has only whitespace before that indicator, the script could un-indent for you. Similar things have been done recently, and if you need help, we could dig up links to those previous discussions, and/or someone might be willing to hack up a script engineer a solution for you, if it catches their fancy

Log in to reply