javascript syntax not saving

General questions about using TextPad

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

Post Reply
Reilly
Posts: 3
Joined: Wed Jan 19, 2011 11:35 am

javascript syntax not saving

Post by Reilly »

Hi
I'm using 5.3.1 and having a problem with javascript.syn.
I've copied the java.syn and renamed javascript.syn.
If I select this through Document Properties and tell it to save, while the file remains open the syntax shows ok. When reopening the file the syntax is removed.
I have the Document defined and assigned the .syn file in the Document Class, but it doesn't want to stick.
I have no problems with css or html syntax.
What have I missed?
Regards
E=Mc^2 We are but Energy. Life is ... . Live
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Re: javascript syntax not saving

Post by MudGuard »

Reilly wrote:Hi
I'm using 5.3.1 and having a problem with javascript.syn.
I've copied the java.syn and renamed javascript.syn.
As Java and Javascript are quite different languages, this doesn't make much sense.
Reilly wrote: If I select this through Document Properties and tell it to save, while the file remains open the syntax shows ok. When reopening the file the syntax is removed.
Of course - settings done in Document Properties are temporary.

Reilly wrote: I have the Document defined and assigned the .syn file in the Document Class, but it doesn't want to stick.
Strange - this should work.
Do you have multiple instances of Textpad open?
If so: close all except one, make the changes to the document class in this single instance, close it, and then reopen.
Reilly
Posts: 3
Joined: Wed Jan 19, 2011 11:35 am

Post by Reilly »

Thanks MudGuard but as I was fairly new to js, I thought it best to have a separate file in case I wanted to change some aspect of the syntax.

No, I only had one copy of Textpad open.

I've also tried it with the java.syn. This also didn't work, which is why I suspect I've missed/mucked up something along the way. My question really is, what?

Regards
E=Mc^2 We are but Energy. Life is ... . Live
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Reilly wrote:Thanks MudGuard but as I was fairly new to js, I thought it best to have a separate file in case I wanted to change some aspect of the syntax.
There's nothing wrong with using a separate file for javascript syntax. But it is wrong to use a java syntax file for javascript.
Use a javascript syntax file for javascript.

If you don't have one, download one from here (download - addons - syntax iirc)
Reilly
Posts: 3
Joined: Wed Jan 19, 2011 11:35 am

Post by Reilly »

Thanks MudGuard.
Going through the procedure to change to the new javascript.syn, in the Document Class I found that the included file type was defined as .js rather than *.js. It's working fine now.

Thanks for your help
E=Mc^2 We are but Energy. Life is ... . Live
Post Reply