• Login
Community
  • Login

Comment line style for user defined language

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
36 Posts 11 Posters 29.9k 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.
  • K
    Keith Kranker
    last edited by Feb 10, 2017, 10:07 PM

    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?

    Thanks!

    C 1 Reply Last reply Feb 10, 2017, 10:50 PM Reply Quote 0
    • C
      Claudia Frank @Keith Kranker
      last edited by Claudia Frank Feb 10, 2017, 10:51 PM Feb 10, 2017, 10:50 PM

      @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)

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • K
        Keith Kranker
        last edited by Feb 13, 2017, 5:04 PM

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

        1 Reply Last reply Reply Quote 0
        • Y
          Yaron
          last edited by Feb 13, 2017, 8:44 PM

          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 https://github.com/pnedev/compare-plugin/issues/73#issuecomment-266256708 ?

          Thank you very much.

          Best regards.

          C 3 Replies Last reply Feb 14, 2017, 1:29 AM Reply Quote 0
          • C
            Claudia Frank @Yaron
            last edited by Feb 14, 2017, 1:29 AM

            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?

            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.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • C
              Claudia Frank @Yaron
              last edited by Feb 14, 2017, 2:13 AM

              @Yaron

              STR = steps to reproduce, correct?

              If so, just start npp.

              Cheers
              Claudia

              1 Reply Last reply Reply Quote 0
              • C
                Claudia Frank @Yaron
                last edited by Feb 14, 2017, 2:19 AM

                @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.

                Cheers
                Claudia

                1 Reply Last reply Reply Quote 0
                • Y
                  Yaron
                  last edited by Feb 14, 2017, 2:23 AM

                  Hello Claudia,

                  I’m fine too. :) Thank you.

                  And thanks for testing and replying. I appreciate it.

                  STR = steps to reproduce, correct?

                  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.
                  BR

                  C 1 Reply Last reply Feb 14, 2017, 2:25 AM Reply Quote 0
                  • C
                    Claudia Frank
                    last edited by Feb 14, 2017, 2:24 AM

                    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.

                    1 Reply Last reply Reply Quote 0
                    • Y
                      Yaron
                      last edited by Feb 14, 2017, 2:25 AM

                      Mid-air collision I suppose. :)

                      Thanks again.

                      1 Reply Last reply Reply Quote 0
                      • C
                        Claudia Frank @Yaron
                        last edited by Feb 14, 2017, 2:25 AM

                        @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

                        1 Reply Last reply Reply Quote 0
                        • Y
                          Yaron
                          last edited by Feb 14, 2017, 2:28 AM

                          Hello again Claudia,

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

                          Have a good night. :)
                          BR

                          C 1 Reply Last reply Feb 14, 2017, 2:30 AM Reply Quote 0
                          • C
                            Claudia Frank @Yaron
                            last edited by Claudia Frank Feb 14, 2017, 2:32 AM Feb 14, 2017, 2:30 AM

                            @Yaron

                            no problem - any time again.

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

                            Cheers and good night :-)
                            Claudia

                            1 Reply Last reply Reply Quote 1
                            • Y
                              Yaron
                              last edited by Feb 14, 2017, 2:32 AM

                              That’s important too.
                              Thanks again.

                              BR

                              1 Reply Last reply Reply Quote 0
                              • Y
                                Yaron
                                last edited by Yaron Feb 14, 2017, 2:47 AM Feb 14, 2017, 2:46 AM

                                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.

                                1 Reply Last reply Reply Quote 0
                                • DaveyDD
                                  DaveyD
                                  last edited by Feb 14, 2017, 4:22 AM

                                  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

                                  ATB,
                                  David

                                  1 Reply Last reply Reply Quote 0
                                  • pnedevP
                                    pnedev
                                    last edited by Feb 14, 2017, 9:29 AM

                                    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.

                                    BR

                                    1 Reply Last reply Reply Quote 0
                                    • Roch1995R
                                      Roch1995
                                      last edited by Feb 14, 2017, 1:28 PM

                                      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,
                                      Regards,
                                      Roch (Crictime )

                                      1 Reply Last reply Reply Quote 0
                                      • Y
                                        Yaron
                                        last edited by Feb 14, 2017, 10:28 PM

                                        Hello,

                                        @pnedev,

                                        Thank you for further investing it. I appreciate that.

                                        @DaveyD,

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

                                        BR

                                        1 Reply Last reply Reply Quote 2
                                        • Y
                                          Yaron
                                          last edited by Feb 14, 2017, 10:41 PM

                                          Thanks Claudia. :)

                                          C 1 Reply Last reply Feb 14, 2017, 10:43 PM Reply Quote 1
                                          2 out of 36
                                          • First post
                                            2/36
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors