I have a syntax definition file for an XML document type I use regularly. An example of one line of the document is
<MTSMaterial Name="marlin_MATERIAL_0" ID="0" RenderMode="LightTexture" >
MTSMaterialName is in one keyword group. Name, ID and RenderMode are in another. MTSMaterial is hightlighted, but only Name is highlighted. What is actually happening is only the first keyword of the second set is being highlighted. If I switched it to be
<MTSMaterial ID="0" Name="marlin_MATERIAL_0" RenderMode="LightTexture" >
Then ID would be highlighted and not Name.
Does anybody know why this is happening and how I can fix it? I've included the first part of my syntax file below. I'm using version 4.5.
-Sean
HTML=1
[Syntax]
Namespace1 = 5
IgnoreCase = No
InitKeyWordChars = A-Za-z0-9
KeyWordChars = A-Za-z0-9
BracketChars = []
OperatorChars =
PreprocStart =
HexPrefix =
SyntaxStart = <
SyntaxEnd = >
CommentStart = !--
CommentEnd = --
CommentStartAlt =
CommentEndAlt =
SingleComment =
SingleCommentCol =
SingleCommentAlt =
SingleCommentColAlt =
SingleCommentEsc =
StringsSpanLines =
StringStart = "
StringEnd = "
StringAlt =
StringEsc =
CharStart =
CharEnd =
CharEsc =
Syntax highlighting question
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
Rod
Re: Syntax highlighting question
Hi,
I'm also using version 4.5 and I've noticed a similiar problem. In my case, "Key" words are being highlighted when they happen to be part of a longer word.
My main problem, though, is that "Textpad" doesn't honour a document class's "syntax" file association. I created a new "document class" for Cobol files. I downloaded the syntax file then I created a "workspace" for these files.
I found I had to manually set the "syntax" file for every file in the "workspace". After that, "Textpad" would remember the associations for those particular files as long as I opened them via the "workspace". However, for any additional file added to the "workspace" I had to manually make the "syntax" file association.
Does anyone know how to get this to work as advertised.
Regards,
Rod
I'm also using version 4.5 and I've noticed a similiar problem. In my case, "Key" words are being highlighted when they happen to be part of a longer word.
My main problem, though, is that "Textpad" doesn't honour a document class's "syntax" file association. I created a new "document class" for Cobol files. I downloaded the syntax file then I created a "workspace" for these files.
I found I had to manually set the "syntax" file for every file in the "workspace". After that, "Textpad" would remember the associations for those particular files as long as I opened them via the "workspace". However, for any additional file added to the "workspace" I had to manually make the "syntax" file association.
Does anyone know how to get this to work as advertised.
Regards,
Rod
-
Chad M. Kovac
Re: Syntax highlighting question
Rod: your problem is unrelated to this topic but the solution is to make sure you've created a new file type: Click Configure, select New Document Class. Be sure to associate the file's extension with the new Doc Class. The NAME could be Cobol. The next prompt would be .CBL (if that's the extension).
Then click Configure, Preferences.
Expand Document Classes and select the Cobol Class you created.
Be sure the extension is listed. - Also be sure the extension doesn't exist in another class.
Expand the Cobol class and select the SYNTAX option.
Here you need to be sure that ENABLE Syntax highlighting is ON and that you have the proper syntax file selected.
---- AS to the other problem with keyword highlighting in HTML files, I have the same problem, the same version of TP and the same results..
Then click Configure, Preferences.
Expand Document Classes and select the Cobol Class you created.
Be sure the extension is listed. - Also be sure the extension doesn't exist in another class.
Expand the Cobol class and select the SYNTAX option.
Here you need to be sure that ENABLE Syntax highlighting is ON and that you have the proper syntax file selected.
---- AS to the other problem with keyword highlighting in HTML files, I have the same problem, the same version of TP and the same results..
-
Rod
Re: Syntax highlighting question
Hi Chad,
thanks for your reply.
I have followed your instructions to the letter but to no avail. I load a file with the extension .cbl and the syntax highlighting does NOT appear. I have to right click the document, select "Properties" then ""Syntax" and apply the Cobol syntax. The next time I load that same file, or any other with the .cbl extension, the syntax
association is again not honoured.
Is there a registry setting I can FORCE ??
Thanks for any further help you can provide.
Rod.
thanks for your reply.
I have followed your instructions to the letter but to no avail. I load a file with the extension .cbl and the syntax highlighting does NOT appear. I have to right click the document, select "Properties" then ""Syntax" and apply the Cobol syntax. The next time I load that same file, or any other with the .cbl extension, the syntax
association is again not honoured.
Is there a registry setting I can FORCE ??
Thanks for any further help you can provide.
Rod.
-
Alex Angelopoulos
Re: Syntax highlighting question
You should see all of thedocument classes under the key:
HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes
(it may be HKLM instead on a Win9x OS).
I haven't been able to replicate your problem (which could actually be useful under certain circumstances if I could!)... could you post your registry settings for the Cobol Document class?
HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes
(it may be HKLM instead on a Win9x OS).
I haven't been able to replicate your problem (which could actually be useful under certain circumstances if I could!)... could you post your registry settings for the Cobol Document class?
-
Rod
Re: Syntax highlighting question
Alex,
the settings are below:
(You mentioned HTML so I have that included too)
---Regards,
The COBOL document class registry setting:
REGEDIT4
[HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\Cobol]
"Type"=dword:00000002
"Members"=hex(7):2a,2e,63,62,6c,3b,2a,2e,6c,69,62,00,00
"Properties"=hex:46,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00
"SyntaxProps"=hex:01,00,00,00
"SyntaxFile"="cobol.syn"
"WordChars"="_"
The HTML document class registry setting:
REGEDIT4
[HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\HTML]
"Type"=dword:00000002
"Members"=hex(7):2a,2e,41,53,50,00,2a,2e,43,46,4d,00,2a,2e,48,54,4d,00,2a,2e,\
48,54,4d,4c,00,2a,2e,50,48,50,00,2a,2e,53,47,4d,00,2a,2e,53,47,4d,4c,00,2a,\
2e,53,48,54,4d,00,2a,2e,53,48,54,4d,4c,00,2a,2e,53,54,4d,00,2a,2e,53,54,4d,\
4c,00,2a,2e,57,52,4c,00,00
"Properties"=hex:50,00,00,00,31,00,00,00,01,00,00,00,01,00,00,00
"TabStops"=hex:00,00,00,00,00,00,00,00,04,00,04,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"SyntaxProps"=hex:01,00,00,00
"SyntaxFile"="D:\UTILS\TEXTPAD4_5\System\HTML.SYN"
"WordChars"="_"
Regards,
the settings are below:
(You mentioned HTML so I have that included too)
---Regards,
The COBOL document class registry setting:
REGEDIT4
[HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\Cobol]
"Type"=dword:00000002
"Members"=hex(7):2a,2e,63,62,6c,3b,2a,2e,6c,69,62,00,00
"Properties"=hex:46,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00
"SyntaxProps"=hex:01,00,00,00
"SyntaxFile"="cobol.syn"
"WordChars"="_"
The HTML document class registry setting:
REGEDIT4
[HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\HTML]
"Type"=dword:00000002
"Members"=hex(7):2a,2e,41,53,50,00,2a,2e,43,46,4d,00,2a,2e,48,54,4d,00,2a,2e,\
48,54,4d,4c,00,2a,2e,50,48,50,00,2a,2e,53,47,4d,00,2a,2e,53,47,4d,4c,00,2a,\
2e,53,48,54,4d,00,2a,2e,53,48,54,4d,4c,00,2a,2e,53,54,4d,00,2a,2e,53,54,4d,\
4c,00,2a,2e,57,52,4c,00,00
"Properties"=hex:50,00,00,00,31,00,00,00,01,00,00,00,01,00,00,00
"TabStops"=hex:00,00,00,00,00,00,00,00,04,00,04,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"SyntaxProps"=hex:01,00,00,00
"SyntaxFile"="D:\UTILS\TEXTPAD4_5\System\HTML.SYN"
"WordChars"="_"
Regards,
-
James Tinsky
Re: Syntax highlighting question
I've added the file class, etc. but when I click enable syntax highlighting my syntax file doesn't appear in the select list. I've added php and asp sucessfully but I can't find a few others.