• Login
Community
  • Login

Notepad++ edit existing (C++) syntax

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 4 Posters 341 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.
  • А
    Андрей Счастливый
    last edited by Sep 30, 2023, 8:12 PM

    Hi!
    I ask experts to tell me how to edit the existing (C++) syntax in Notepad++ or add to it - so that parameters that start with $ (for example, $PAR1) are highlighted in a separate color?

    A 1 Reply Last reply Sep 30, 2023, 8:27 PM Reply Quote 0
    • A
      Alan Kilborn @Андрей Счастливый
      last edited by Sep 30, 2023, 8:27 PM

      @Андрей-Счастливый said in Notepad++ edit existing (C++) syntax:

      parameters that start with $ (for example, $PAR1) are highlighted in a separate color?

      Is this a valid C++ syntax?
      Can you show some examples if you think so?

      You might have luck with the EnhanceAnyLexer plugin, but I don’t think you’ll be able to do what you wish with the Notepad++ processing of C++.

      R P 2 Replies Last reply Oct 1, 2023, 3:28 AM Reply Quote 3
      • R
        rdipardo @Alan Kilborn
        last edited by Oct 1, 2023, 3:28 AM

        @Alan-Kilborn said in Notepad++ edit existing (C++) syntax:

        Is this a valid C++ syntax?

        Lexilla has optional support for it:

        lexer.cpp.allow.dollars Set to 0 to disallow the ‘$’ character in identifiers with the cpp lexer.

        https://www.scintilla.org/SciTEDoc.html

        Since the default is 1, and the editor does not disable it , C/C++ identifiers containing $ should already appear valid to the lexer. The only problem is the lack of special styling. The plugin recommended above would be sufficient for that.

        1 Reply Last reply Reply Quote 3
        • P
          PeterJones @Alan Kilborn
          last edited by Oct 1, 2023, 3:44 PM

          @Alan-Kilborn said in Notepad++ edit existing (C++) syntax:

          Is this a valid C++ syntax?

          it’s a “tolerated” extension to standard C++, as far as i can gather. [1]

          A 1 Reply Last reply Oct 1, 2023, 4:16 PM Reply Quote 1
          • A
            Alan Kilborn @PeterJones
            last edited by Alan Kilborn Oct 1, 2023, 4:20 PM Oct 1, 2023, 4:16 PM

            Yuck to using $ in such a way in C++ – is that really needed? (purely a rhetorical question since this is not the forum for it).

            1 Reply Last reply Reply Quote 0
            5 out of 5
            • First post
              5/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors