Block Comments Line By Line

Block Comments Line By Line

14
Basic UserBasic User
14

    Aug 09, 2005#1

    I'm writing code in a language that uses old C style comments (/* ... */). I have my Block Comment On/Off defined and the highlighting works fine. But my Edit > Comment Add/Remove menu selections are grayed out.

    I'd like to be able to highlight a multi-line code block and have UE comment the lines out like this:

    /* line 1 */
    /* line 2 */
    /* line 3 */
    ...


    Not like this:

    /* line 1
    line 2
    line 3 */


    So I guess my question is twofold: Why is my Add/Remove comment menu selections unavailable and is there a way to comment out multiple lines, each line complete with a start and end comment delimiter?

    Thanks.

    6,686585
    Grand MasterGrand Master
    6,686585

      Aug 09, 2005#2

      Comment Add/Remove is only available if the syntax highlighting definition for the current file has specified a line comment, because Comment Add/Remove only works with line comments by simply adding or removing for example // at begin of each line of the selection. So you can't use it for commenting each line with the block comment characters.

      You have to write a macro for add/remove each line with block comments. Maybe someone has already written such macros. Search the forum or wait a little time, maybe someone posts the macro codes. It is not really difficult to do this with simple regular expression replaces on current selection.
      Best regards from an UC/UE/UES for Windows user from Austria