Community
    • Login

    How to implement a UDL definition to include everything on the left side of an = sign?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 190 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.
    • Random EncounterR
      Random Encounter
      last edited by

      I’ve been trying to mess with this for awhile now, attempting to use the ((EOL)) modifier and such things to compose a delimiter that starts with an ((EOL)) and ends with = but it doesn’t seem that ((EOL)) can be used in the Open section of a delimiter - it just fails. Is there any other way I might accomplish this? Kind’ve at a loss, and I’m getting a bit frustrated. Thank you in advance, and I’m sorry if this question has been answered elsewhere - I couldn’t figure out the search criteria to allow me to hit on what I’m looking for without parsing a big list of returns.

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

        @Random-Encounter ,

        UDL is not all-powerful: it focuses on defining a list of keywords, rather than arbitrary pattern matches, for syntax highlighting, so it cannot do what you want.

        However, the EnhanceAnyLexer plugin can apply the power of regex to change the foreground color of certain text; so you could install that plugin, define most of your language with the UDL interface; then, to get things to the left of an = to be a different color, use Plugins > EnhanceAnyLexer > Enhance Current Language, which will add or edit a section in its config file for your current language: the section will start with [NameOfUDLhere], and then consist of “color = regex” pairs (if the colors are in hex, it’s 0xBBGGRR for the blue, green, and red portions), along with a config line for “excluded_styles = …” which you probably don’t need to worry about)

        For my example, since I’m just using the dummy “Default Langauge” (which internally is labled as udf), I can use the following config section to get it to highlight text on the left of the = with brownish-orange:

        [udf]
        0x66ad1 = ^.*(?=\=)
        

        42434862-d71d-4824-920a-b839722f7d37-image.png

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