Page 1 of 1

javascript syntax not saving

Posted: Wed Jan 19, 2011 11:45 am
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

Re: javascript syntax not saving

Posted: Wed Jan 19, 2011 4:13 pm
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.

Posted: Wed Jan 19, 2011 4:41 pm
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

Posted: Wed Jan 19, 2011 8:48 pm
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)

Posted: Thu Jan 20, 2011 10:43 am
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