Syntax higtlighting on file without extension

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
13Qiao
Posts: 14
Joined: Thu May 19, 2005 8:15 pm
Location: Toronto, ON

Syntax higtlighting on file without extension

Post by 13Qiao »

Hi There,

I want to use java syntax highlight on filename pattern *JPO (postfix with JPO, no extension). I tried *JPO, *JPO. and *JPO.*, but none of them worked. Could Textpad do it?

Thanks,
Yong
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Make sure there is no document class below yours in the list which takes files without extension (the list is checked bottom to top for the first match)
User avatar
13Qiao
Posts: 14
Joined: Thu May 19, 2005 8:15 pm
Location: Toronto, ON

Post by 13Qiao »

There isn't any pattern without extension except the default doc class (*.*) which is above my Java doc class.
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

Please try this:

Make sure you only have one instance of TextPad open.

From the Configure menu, choose New Document Class. Type ZJPO for the Document class name. Click Next. Type *JPO for the class member. Click Next. Tick Enable syntax highlighting, and choose java.syn from the drop down list. Click Next/Finish.

When you open a *JPO document, it should now have java.syn applied to it.

I hope this helps.
Helios Software Solutions
User avatar
13Qiao
Posts: 14
Joined: Thu May 19, 2005 8:15 pm
Location: Toronto, ON

Post by 13Qiao »

helios, I followed your instructions, but it still does not work.
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

Sorry, you need to make *.* a member of the files in class for ZJPO. When you do this, a dialog box will inform you that *.* is also a member of the Default class. Just OK it.
Helios Software Solutions
User avatar
13Qiao
Posts: 14
Joined: Thu May 19, 2005 8:15 pm
Location: Toronto, ON

Post by 13Qiao »

Unfortunately, after adding *.* to ZJPO doc class, it still does not work.

Now, ZJPO is the last Doc class in the list, and it has *.* and *JPO files in class. I tried different orders of *.* and *JPO. None of them worked.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Try
*.
User avatar
13Qiao
Posts: 14
Joined: Thu May 19, 2005 8:15 pm
Location: Toronto, ON

Post by 13Qiao »

*. does not work.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

*. works for me.
User avatar
13Qiao
Posts: 14
Joined: Thu May 19, 2005 8:15 pm
Location: Toronto, ON

Post by 13Qiao »

OK, here is what I found. If I open a new file like *JPO, it works. If I open a saved workspace contains *JPO, it doesn't work. If I close that *JPO file, and open it again within the workspace, it works.

It looks like the workspace file is not reading the latest doc calss settings...

Thanks for the help.
smile
Posts: 1
Joined: Fri Aug 18, 2006 9:56 am

Post by smile »

OK, here is what I found. If I open a new file like *JPO, it works. If I open a saved workspace contains *JPO, it doesn't work. If I close that *JPO file, and open it again within the workspace, it works.

It looks like the workspace file is not reading the latest doc calss settings...
Indead, was ein Mist!
More than one year has gone and nothing changed at this strange behaviour, wasting many hours for me and others!!!

There should be a refresh-Button for workspace!
Post Reply