• Login
Community
  • Login

Comment left align

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 2 Posters 311 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    Jürgen Nießen
    last edited by Jan 7, 2021, 10:19 PM

    Is there a setting , so that the comment is like

          code 
    //    code
    

    instead of

           code
           // code
    

    ?

    P 1 Reply Last reply Jan 7, 2021, 10:32 PM Reply Quote 0
    • P
      PeterJones @Jürgen Nießen
      last edited by PeterJones Jan 7, 2021, 10:34 PM Jan 7, 2021, 10:32 PM

      @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
      1 Reply Last reply Reply Quote 3
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors