Community
    • Login

    # colors lines comments when they should not be

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 82 Views 1 Watching
    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.
    • Steve ValliereS Offline
      Steve Valliere
      last edited by

      Basic Info: Running on Windows 11, fully up-to-date as of this post. Using Notepad v8.9.8.1 (64-bit)

      I am sure this is somehow my fault and I am hoping folks will take pity on me and help… (hopeful smile)

      When I edit INI files, lines that begin with EITHER a semicolon ‘;’ OR a hash mark (AKA pound symbol, ‘#’) are colored as comments. HOWEVER, the Windows INI processing functions DO NOT consider a ‘#’ symbol as a comment marker.

      I have not touched the langs.xml file that was installed with Notepad++ and when I looked at it, I didn’t see anything that indicated it should consider the ‘#’ to begin a comment line.

      I have also created my own language definition for a custom config file type that I use. My files also use an initial semicolon as a comment marker and also do not use an initial ‘#’ as a comment marker. HOWEVER, Notepad++'s syntax coloring disagrees and colors lines starting with a ‘#’ as comments anyway.

      Is this a bug in Notepad++'s syntax coloring system, or is there some way that I defined ‘#’ as a comment indicator in both INI and my custom files without ever actually referencing that particular character in the files (except as an operator in my custom language definition)?

      How can I correct this annoying behavior? Since I also maintain config files on some linux servers, I often mix up the comment characters and Notepad++'s incorrect coloring is causing it to take longer than it should for me to notice my mistakes.

      Thanks! I hope…

      Lycan ThropeL 1 Reply Last reply Reply Quote 0
      • Lycan ThropeL Offline
        Lycan Thrope @Steve Valliere
        last edited by Lycan Thrope

        @Steve-Valliere ,
        Best suggestion I can give you is to look at the EnhanceAnyLexer plugin, and create a change of coloring to match what a # is colored in the Windows INI prossing functions, that would give you the comfort of knowing they aren’t comment indicators and prevent your files, while being edited in NPP, from seeing a # as a comment marker.

        Enable that plugin through the manager, read up on the instructions, and it should take care of what you need, using stock NPP ini file language recognition.

        Good luck.

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors