Community
    • Login

    need help with a style for a .cfg

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 112 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.
    • Beau ThompsonB
      Beau Thompson
      last edited by

      Hi all I have a .cfg file that I am trying to edit
      it is hard to read
      here is what I get 57f903a9-de81-4c07-b85d-d43cd23f06fd-image.png
      here is what I am looking for
      accc2369-28a7-4724-8a85-7c6e0fc8778f-image.png
      I tried looking here
      53a5e31f-6dda-43a3-a3bf-a51e71f78db0-image.png
      thanks for any help

      PeterJonesP 1 Reply Last reply Reply Quote 1
      • PeterJonesP
        PeterJones @Beau Thompson
        last edited by PeterJones

        @Beau-Thompson ,

        You are in the right area:

        • the COMMENT styles affect the lines that start with #
        • the SECTION styles affect the [QoLmod] headers
        • the ASSIGNMENT styles affect the = between the key and value
        • the KEY styles affect the setting name (like lastUsername, to the left of the =)
        • the DEFAULT styles affect the value (to the right of the =)
        • I am not sure, but I am guessing the DEFVAL is an error condition (since it’s red in the default light-mode styler)

        So you can set the colors for each of those styles to match your desires.

        The “Properties” language appears to not recognize comments at the end of a setting – that’s most likely because either the “Lexilla” library that Notepad++ uses for parsing the files doesn’t recognize that variant of the loosely-related slew of file-types that make up the “Properties” and “INI” filetypes, or because there’s an option for Lexilla’s “Properties” lexing which Notepad++ doesn’t use; I haven’t looked into which it is. Either way, it would require a fix in Notepad++ and possibly a fix in Lexilla before it (though if it is an option, then you could make use of the PythonScript plugin, or similar, to automatically set that Lexilla option even though Notepad++ itself doesn’t).

        For the comment-after-assignment, there is a possible workaround:

        • install EnhanceAnyLexer plugin
        • open your QoLmod.cfg
        • Plugins > EnhanceAnyLanguage > Enhance current language
        • it will open EnhanceAnyLexerConfig.ini in your other View, and create a section called [properties file]. You could set that section to
          [properties file]
          0x00aa00 = \S\s*\K#.*
          
          (making sure to not keep excluded_styles or to comment out that line)
          and save the EnhanceAnyLexerConfig.ini
        • Going forward, the plugin should change the end-of-line # .... comments to a shade of green. (It will happen automatically the next time you open properties files, once the plugin config has been saved)

        The limitation with EnhanceAnyLexer is that it cannot change bold/italics/underline status, and cannot change background color. So it won’t exactly match the italicized normal COMMENTS style, but it will be close.

        ----
        update: In the LexProps source code, I only see lexer.props.allow.initial.spaces and fold.compact, so as far as I can find, Lexilla does not provides a way to allow comments at the end of a line. As a result, someone would have to request that the Lexilla project add that feature, and they would have to implement and publish it, then Notepad++ would have to update to the most recent Lexilla.
        Also, it appears that DEFVAL is used for the @ symbol for “default value”, not an error condition.

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