Menu

Please improve comment/uncomment ala SciTe

2007-05-24
2012-11-13
  • Nobody/Anonymous

    I find Notepad++ the best source code editor after SciTe, but I would seriously consider changing if the comment/uncomment functionality was improved. (I comment alot!!)

    I would like to comment a line without selecting a character on the same line

    I would like to control where the comment character is inserted. (At beginning of line or at caret or start of first word...)

    Thanks

     
    • IronFox

      IronFox - 2007-05-25

      "I would like to comment a line without selecting a character on the same line"

      ...never used SciTe but the way you describe it, it appears like it can read your mind.
      How do you specify which line to comment? In what system anyway? C-style? html? configuration files?
      Sounds like you are refering to line comments and not block comments. Though a mind reading block commenter would be awesome.

      "I would like to control where the comment character is inserted. (At beginning of line or at caret or start of first word...)"

      How? Additional key-combo's? I haven't tried the macro feature yet but maybe it will do what you want.

      All these individual modification request make me wonder if it wouldn't be that far-fetched to embed a powerful event-driven scripting language into the editor's core functionality. Could rewrite most of the other functionalities into this script language allowing ultimate customizability without requiring much understanding of the underlying C-code.
      Hmhm...

       
    • Nobody/Anonymous

      hmm...
      No sarcasm here :)

      What I was trying to refer to was this: (from the help file in SciTe)

      --------------------------------------------------------
      These settings are for the comment commands in the
      Edit menu and are defined separately for each lexer.
      Not all languages support both stream and block
      comments.
      Block comments are comments that start with a
      particular string and continue until the end of line.
      The comment.block property sets the string to be
      inserted or deleted at the start of the selected lines
      when the Block Comment or Uncomment command is
      performed. To make this command perform sensibly over
      a range of text that already contains comments and
      other code, the string can be defined to contain a
      character such as '~' that is not used in real comments.
      Set comment.block.at.line.start to "1" to place block
      comment symbols at the start of the lines, instead of
      just before the first non-blank character of the lines.
      Stream comments start with a particular string and end
      with another particular string and may continue over
      line ends. These are defined with comment.stream.start
      and comment.stream.end.
      Box comments are a form of stream comment that takes
      several lines and uses different strings for the
      start, end and other lines in the range. These are
      defined with comment.box.start, comment.box.middle and
      comment.stream.end.

      comment.block.lexer
      comment.block.at.line.start.lexer
      comment.stream.start.lexer
      comment.stream.end.lexer
      comment.box.start.lexer
      comment.box.middle.lexer
      comment.box.end.lexer
      --------------------------------------------------------

      This way I can configure each programming language the way I like. If I'm scripting in javascript maybe I like my line comments to be "//~" and at-line-start and something else for an other language.

      Psychic

       
      • Don HO

        Don HO - 2007-05-28

        > This way I can configure each programming language the way I like.

        You can modify them in langs.xml

        Don

         
        • Nobody/Anonymous

          > You can modify them in langs.xml

          I'm aware of that, but I would really be great if the "at.line.start" option was available. I think code looks more structured if the comment characters have the same indentation (but that's just me).
          The other feature I mentioned was the possibility to execute line "comment/uncomment" without selection.

          Thanks

          Psychic/Nic

           
    • Nobody/Anonymous

      And also, it would be great to have two separate functions: one for comment and one for uncomment.
      Because the actual function takes the negative of the selected lines.
      So if we have a block with a comment line at the beginning, like:
      // This block does this
      Bla-bla

      We can select the whole block and de-activate by commenting all of it.

      Thank you