How to define control characters End of Medium and End of Transmission Block as matching brace strings?

How to define control characters End of Medium and End of Transmission Block as matching brace strings?

14
Basic UserBasic User
14

    Jul 21, 2019#1

    🤓 Greetings to all you great people out there who have understood that UE is the BEST!

    I am using French UltraEdit version 14.00+4 mainly with code page Windows-1252. I added control character End of Medium with hexadecimal value 0x19  to language 7 for C#  to /Open Brace Strings and End of Transmission Block with hexadecimal value 0x17 to Close Brace Strings, saved the wordfile and restarted UE. Brace matching of ( ) [ ] { } work with all file extensions, but my addition does not.
    HELP 😎 (Grand master Mofi!)
     
    PS: Finally managed to get it working in *.cs files. But would like use it in my own *.ya file extensions.

    Also in what %APPDATA% file is recorded UltraEdit's toggle (true/false) for brace matching in comments?

    Brace matching of ( ) [ ] { } work in *.ya (all) file extensions, but my addition does not which begs the question: How does wordfile.uew handle the idea of a default (for unspecified file extensions like my *.ya) brace matching scheme? 🤓
    WORDFILE.UEW (171.49 KiB)   0

    6,603548
    Grand MasterGrand Master
    6,603548

      Jul 22, 2019#2

      Embedded in UltraEdit code since v11.00a is the support for brace matching of ( ) { } [ ] for non-syntax highlighted files and for syntax highlighted files of which language definition does not contain /Open Brace Strings = and /Close Brace Strings =. Those default brace matching character pairs cannot be redefined somewhere. They are fixed defined in code of UltraEdit.

      The user of UltraEdit v14.00 has the freedom to modify any syntax highlighting definition language in used wordfile wordfile.uew and add other syntax highlighting languages. In UltraEdit v14.00 up to 20 languages can be defined in wordfile.uew. You have modified the brace matching strings for syntax highlighting language C# which syntax highlights all files with file extension CS (case-insensitive) according to definition in the wordfile. You have not associated file extension YA with any syntax highlighting definition in used wordfile. For that reason all files with file extension YA are not syntax highlighted by default at all which means UltraEdit built-in brace matching definition becomes effective for those files.

      You have three possibilities:
      1. File extension YA is appended to an existing and suitable language definition in wordfile.uew like /L7"C#" at end of the line.
      2. An additional language definition is added to wordfile.uew, for example

        /L14"YA files" Noquote File Extensions = YA
        /Delimiters = ETBEM (tab)[]{}
        /Open Brace Strings =  "{" "(" "[" "EM"
        /Close Brace Strings = "}" ")" "]" "ETB"
        /C1"End of control chars"
        ETB
        EM

        Note: ETB is used here as placeholder for control character End of Transmission Block (0x17),  EM as placeholder for control character End of Medium (0x19), and tab as placeholder for a horizontal tab character (0x09). It is up to you what else should be added to such a language definition for *.ya files. That is just an example with the absolute minimum based on what I know from your post for files with file extension YA which is not much.
      3. A space and an asterisk * is appended to a language definition at end of first line like /L7"C#" to define this syntax highlighting language to be used for all files not being associated with any syntax highlighting language in the wordfile. Well, this feature in combination of second possibility for adding a custom language definition makes it in real possible to define a default brace matching for all files not syntax highlighted with a language with own set of open/close brace strings.
      The configuration setting Brace match in comments is stored like all other configuration settings in uedit32.ini. It is a syntax highlighting language independent configuration setting. So it is not possible to configure that this setting is enabled for some languages and disabled for other languages. It is only possible to customize for each syntax highlighting language in the wordfile which character pairs are used by the brace matching commands and for auto-brace matching feature. Of course it is possible to disable more or less the brace matching feature with /Open Brace Strings = "" and /Close Brace Strings = "" defined for a syntax highlighting language for all files syntax highlighted with this language.
      Best regards from an UC/UE/UES for Windows user from Austria

      14
      Basic UserBasic User
      14

        PS afterthought on File Extensions =

        Jul 23, 2019#3

        😎 Greetings. What a perfectly complete answer... Thanks again, MOFI! 😎
        🤓In my original wordfile.uew (here included) does (line 2024) File Extensions = 

        /L10"VBScript ASP" Nocase ASP_LANG Line Comment = ' Line Comment Alt = REM Block Comment On = /* Block Comment Off = */ Block Comment On Alt = <!-- Block Comment Off Alt = --> String Chars = " File Extensions =

        Is that making L10"VBScript ASP" my default ?