Comment line style for user defined language

  • I’d like to fix an issue with my User Defined Language that I wrote for Stata.

    Stata’s language has 4 types of comments:

    • /* */ is used to create comment blocks
    • comment lines:
      • “*” must appear at the beginning of the line. If “*” is not the first character it is treated as a multiplication sign.
      • “\\” can appear anywhere in the comment line. Anything appearing after “\\” is treated as a comment. The next line in the code is treated as a new line.
      • “\\\” can appear anywhere in the comment line. anything after “\\\” is treated as a comment. The next line in the code is treated as a continuation of the previous line.

    My problem is that I don’t know how to configure this in the Notepad++ “user defined language” dialog box. Depending on how I toggle the “line comment position” option, I can get one or another style to work. But I can’t figure out how to get all four types of comments to work at the same time.

    Any suggestions?


  • @Keith-Kranker

    what about the following.

    Use force at beginning of line
    For comment line style use * as open
    For comment style use the normal /* for open and */ for close
    Now the trick
    Use a delimiter and assign the same color as for comment
    for open put in \\\ \\
    and for close ((EOL)) ((EOL))

    Looks like this does it. (note I used different colors for demonstration)


  • Fantastic! Thanks so much. It worked like a charm.

  • Hello @Claudia-Frank,

    It’s been a long time.
    I hope you’re doing well.

    Allow me an off-topic question.
    The Compare Plugin buttons are all enabled in your screenshot.
    It looks like you didn’t have an active Compare at the time, is that correct?
    If correct, could you please list the STR this state (i.e. no active Compare and all buttons enabled).

    Is it

    Thank you very much.

    Best regards.

  • Hello @Yaron,

    I’m fine thx - I hope you as well?

    It looks like you didn’t have an active Compare at the time, is that correct?


    If correct, could you please list the STR this state (i.e. no active Compare and all buttons enabled).

    What do you mean by list STR this state?
    I checked the link and my recent history list isn’t empty - I assume it isn’t since
    starting npp for the very first time ;-)

    Please be aware that I’m using npp under wine - I don’t have any windows environment
    at the moment.


  • @Yaron

    STR = steps to reproduce, correct?

    If so, just start npp.


  • @Yaron

    Regardless if I have a history or not, whether I have opened files (old session) or only new 1
    buttons are always active. If I press compare button, then I do get the warning that
    only one file is active and action is being ignored and clear active button gets disabled.


  • Hello Claudia,

    I’m fine too. :) Thank you.

    And thanks for testing and replying. I appreciate it.

    STR = steps to reproduce, correct?


    If so, just start npp.

    Session restored and any files opened?
    No files on starting NPP?
    Are all the buttons enabled in both cases?

    If you Compare and then Clear Active Compare, are some of the buttons disabled?

    Do you use the Customize Toolbar plugin?

    Thanks again.

  • If I do compare files and then press clear active compare, the active compare button together with the navigation buttons do get greyed out. Restart npp -> all active.

  • Mid-air collision I suppose. :)

    Thanks again.

  • @Yaron

    yes, always active - regardless if many files are open or only one (the new one).

    Notepad++ v7.3.2 (32-bit)
    Build time : Feb 12 2017 - 23:15:39
    Path : C:\programs\notepad++\notepad++.exe
    Admin mode : ON
    Local Conf mode : ON
    OS : Windows 7 (64-bit)
    Plugins : ComparePlugin.dll Explorer.dll mimeTools.dll NppConverter.dll NppExec.dll NppExport.dll PluginManager.dll PythonScript.dll Tidy2.dll XMLTools.dll

  • Hello again Claudia,

    Thank you very much. It’s been helpful and I appreciate that.

    Have a good night. :)

  • @Yaron

    no problem - any time again.

    Btw. Just a note, the menu entries are greyed out.

    Cheers and good night :-)

  • That’s important too.
    Thanks again.


  • Hello Claudia,

    Just to close the issue here.
    Both @pnedev and myself use the Customize Toolbar plugin and with it the buttons state is handled properly.
    I’ll refer Pavel to the issue.

    Again, thank you and good night.

  • Hi Yaron, Pavel, Claudia
    First of all, big thanks to @pnedev for further developing this great plugin! I use it regularly. And of course, thanks to @Yaron for pushing the development and QA (and anything else I dont know about :) )
    And… thanks to @Claudia-Frank for all his great work and help on this forum!

    For what it’s worth, I’ve tested the plugin in regard to the above conversation, and I can verify that I get the same behaviour as @Claudia-Frank.

    On start, all icons are enabled. When clearing a recent compare, the “Clear active compare” icon gets disabled, but the rest remain enabled.

    Notepad++ v6.9.1
    Build time : Mar 28 2016 - 19:48:40
    Path : C:\Programs\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : ON
    OS : Windows 10


  • Hello guys,

    Thank you all for testing, commenting and reporting.
    This issue looks to me like some inconsistency during toolbar ready N++ start-up phase.
    I’ll investigate further and write back but in another thread as this off-topic is becoming the main discussion here.


  • Hello, I am not getting any way to run np++ on my mac, is there any way out to run it on My mac. Plz help, thx in advance,
    Roch (Crictime)

  • Hello,


    Thank you for further investing it. I appreciate that.


    Thank you for testing and confirming. Appreciated.
    Dear @Claudia-Frank is a lady. I made this mistake too. :)


  • Thanks Claudia. :)

Log in to reply