How to highlight %VARIABLE% and VARIABLE

How to highlight %VARIABLE% and VARIABLE

2
NewbieNewbie
2

    19:37 - Jan 30#1

    How can I configure the wordfile to highlight a word that is surrounded by other characters?

    Example:
    %VARIABLE%
    [VARIABLE]

    Relase: 2023.2.0.27 64-bit

      19:38 - Jan 30#2

      Is there comprehensive documentation on Wordfiles anywhere?

      6,675585
      Grand MasterGrand Master
      6,675585

        6:36 - Jan 31#3

        That could be done with:

        Code: Select all

        /Marker Characters = "%%[]"
        /C1"Variables"
        %%
        /C2"Sections"
        []
        
        But there is a bug since since UltraEdit for Windows v23.10.0.1 resulting in marker characters not working anymore if the same character is used for beginning and end of the marked string like with the definition %%. That worked up to UE v23.00.0.59. I reported this syntax highlighting bug by email on November 16, 2022. But it looks like I am the only user who recognized that (for syntax highlighting environment variable references in batch files) as this syntax highlighting bug is still not fixed in currently latest UltraEdit for Windows v2023.2.0.27 (v30.2.0.27 in former versioning scheme). The syntax highlighting works for strings marked by two different characters like [].

        If there is left and right the character % always a word delimiter according to the delimiters definition in the wordfile, it would be also possible using in the wordfile just the substring definition:

        Code: Select all

        /C1"Variables"
        ** %
        That syntax highlights all words (according to /Delimiters = in the wordfile and not according to human understanding or Unicode specification) beginning with % and the character % itself on next character is a word delimiter. But this substring highlighting definition cannot be used for batch files for syntax highlighting environment variable references as they are often embedded in larger strings.

        Another possibility is using the block or alternate block comment highlighting for strings beginning with a character and ending with another character in the first line of a syntax highlighting wordfile like:

        Code: Select all

        Block Comment On = [ Block Comment Off = ]
        or

        Code: Select all

        Block Comment On Alt = [ Block Comment Off Alt = ]
        But getting the strings between the square brackets interpreted as block comments is often not useful. The marker characters definition is definitely better in most uses cases and working due to different characters for beginning and end of marked string.

        There is a large help page with title Syntax Highlighting (Configuration - Editor Display) which can be opened by opening Advanced - Settings or Configuration - Editor display - Syntax highlighting and clicking on button Help or clicking on Help Index, selecting the second tab Index on not preselected, entering the word syntax, double clicking on selected Syntax highlighting in the list and double clicking in the opened Topics found window once again on Syntax highlighting. There is also the sticky forum topic Template for syntax highlighting language wordfile with additional information which cannot be found on the help page.
        Best regards from an UC/UE/UES for Windows user from Austria