Community
    • Login

    Don't treat parenthesis as codeblocks start/end

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 205 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.
    • geoslakeG
      geoslake
      last edited by geoslake

      Hi guys,

      I store some of my files containing passwords and things in cpp files created with np++.
      I use cpp because the formatting is fine for my use case and taste, but i could use another language.
      I’d like to know if there’s a way to NOT treat parenthesis (for example) as language functions but as simple symbols like letters and so on.
      I know i could create my own “user defined language” but its pretty cryptic to me, and cpp is fine, so i would just need to edit the existing cpp language if possible, or something like that…

      Thanks and cheers

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @geoslake
        last edited by PeterJones

        @geoslake ,

        Without editing the source code and compiling your own copy of Notepad++ and the libraries it ships with, you are not able to change the logic of the built-in languages like C++. It would be a lot easier to create a User Defined Language (UDL) than it would be to modify the logic for C++.

        I would suggest trying to learn the UDL. You don’t tell us anything about your pseudo-language for your “passwords and things” (whether there are “keywords” you want to have highlighted, whether you use braces for nesting, and that sort of thing), so it’s hard to give you any hints. But the Language > User Defined Language > Define Your Language has a link to its documentation in the dialog box / panel, and that documentation is pretty newbie-friendly, IMO.

        -----
        edt: “don’t treat parentheses as codeblocks start/end” => do you mean () (which are generally called parentheses) or {} (which are often called curly braces or just braces). If you don’t want curly braces to be interpreted as blocks for indentation/folding, then the CPP lexer really isn’t the best choice for you. I really think you need to show us some example text (use the </> in the forum to mark that text as plain text), then paste in a screenshot of the text as highlighted by the lexer, and maybe explain which elements of the highlighting you like, and which you don’t. Because if all you have is a list of keywords that you want highlighted, then the UDL is dead simple: just go to the keywords tab, type those keywords, assign a color in the Style button, and maybe put a default extension for your so that a file with that extension will always use your UDL.

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