Page 1 of 1

Syntax Highlighting

Posted: Tue Mar 31, 2009 3:33 pm
by daveabrock
Hello,

When using TextPad for a Java program, I cannot see syntax highlighting. I have enabled Java functionality and even have the "Enable Syntax Highlighting" checkbox enabled. I've saved the file as a Java file, rebooted, and tried everything that could come to mind. Advice?

Posted: Tue Mar 31, 2009 4:13 pm
by talleyrand
What syntax file are you using? text.syn (possibly the default) or something like java.syn

Assuming it's java.syn, click the Open button on the syntax tab and it should open a file that looks approximately like

; TextPad syntax definitions for Java
; Copyright (C) 1998-2000, Helios Software Solutions

C=1
{snip}

Posted: Tue Mar 31, 2009 4:16 pm
by daveabrock
Thanks for the reply.

When I go to Configure > Preferences > Document Classes > Java >Syntax, "java.syn" is listed. When clicking open, the file opens exactly as you stated.

Posted: Tue Mar 31, 2009 4:41 pm
by helios
In order to enable the syntax highlighting, you will need to implement the following procedure for each document class, as in the example below:

Click on:

1. Configure
2. Preferences
3. Plus sign next to Document Classes
4. Plus sign next to "Java"
5. Syntax
6. Check the "Enable syntax highlighting" box.
7. Under the heading "Syntax definition file" Select
"java.syn".
8. Click Apply / OK

Please ensure that *.java is a member of the Files in class as follows:

1. Configure
2. Preferences
3. Plus sign next to Document Classes
4. Click on Java(not the plus sign next to "Java")
5. Under the heading "Files in class", make sure that *.java is in the list. If it is not there, then you will need to add it to the list, along with any other file extensions that you are using for Java files.
6.Click Apply / OK

New documents must be saved with the relevant extension, in order for the syntax highlighting to be activated.

This information is also available from here:

http://www.textpad.com/forum/viewforum.php?f=9


I hope this helps.

Posted: Tue Mar 31, 2009 4:46 pm
by daveabrock
I saw that post and tried that and I am still not able to see highlighting enabled.

Posted: Tue Mar 31, 2009 6:14 pm
by Bob Hansen
It's possible your changes were not retained. Be sure to do this:

1. Close all other copies of TextPad.
2. Close all open documents in TextPad, including any default blank document.
3. Make the Configuration changes detailed in earlier solution
4. Apply and OK your way out and close TextPad.
5. Reopen TextPad and confirm the settings were retained.

Posted: Tue Mar 31, 2009 6:38 pm
by daveabrock
Bob,

Thanks for the reply. I tried that with no luck. This is very mysterious as to why this is not occurring.

Posted: Tue Mar 31, 2009 6:52 pm
by Bob Hansen
What is your filename and extension?
Is the extension listed in the extensions for the Java Class?

It was noted to have *.java in your class group. You should include any extenstions you might use for java. I have three in my Java Class:
*.JAVA / *.JAV / *.JS

Posted: Tue Mar 31, 2009 7:13 pm
by daveabrock
Yes, I have Java extensions listed in my classes.

Posted: Tue Mar 31, 2009 7:47 pm
by talleyrand
Is this a home machine or a work machine? If work, then perhaps a permission issue?

Posted: Tue Mar 31, 2009 7:55 pm
by daveabrock
I have no restrictions on this machine.

Posted: Wed Apr 01, 2009 8:31 am
by helios
In order to confirm that the syntax highlighting really is enabled for that specific document, please try right clicking in the document and choose Properties/Syntax.