Syntax files revisited

General questions about using TextPad

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

Post Reply
Mournblade
Posts: 9
Joined: Thu Jun 26, 2003 11:31 pm
Location: Middlesbrough, England

Syntax files revisited

Post by Mournblade »

I was editing a syntax file and added a keyword. I then closed down Textpad reopened the file (you really need a refresh command for that), and instantly noticed that the syntax hadn't taken hold. Perplexed I opened the syntax file and there it was - staring back at me.

So I deleted the document class and recreated it. Still didn't work - it was the same as the previous version.

Thinking that Windows had cached it I rebooted my PC. *bing* Still the same as before.

Annoyed I copied all the syn files from System to a folder in My Documents, deleted the document class from the list, closed Textpad, restarted it, created my class, went to select the only remaining .syn file and found a fully populated list!? Where did this populated list come from?
I quickly discounted the idead that maybe it listed all the syn files employed by other file types since where did the awk and autolisp stuff come from?

Then I went and totalled the registry entries regarding the document classes (I backed them up first) and reopened TextPad. They were gone. Create a new syntax and the list is still there.

I then checked out the other directories. Samples had syn files in it too. So I delete all those, go to create a document class and the remaining syntax in System appears - lo and behold it works.

So which directory should syntax files go into? Samples or system?
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

I wrote an AutoIt program that lets you automatically reload the syntax file for the active document.
Create a user-defined tool with:
- Command: AutoIt3.exe
- Parameters: "Reload Syn File.au3"

(The script works--at least it works on my computer--by right-clicking the document, Properties > Syntax > unchecking syntax highlighting > Apply changes > recheck syntax highlighting > selecting the original SYN file > OK)
Mournblade
Posts: 9
Joined: Thu Jun 26, 2003 11:31 pm
Location: Middlesbrough, England

Post by Mournblade »

That doesn't answer my question: Do the syntax files go in the System or the Samples directory?
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

I know it doesn't answer your question; I'm not sure of the answer my self!

But take a look here:
TextPad > Configure > Preferences > Folders
You'll the see the folder where you should probably install user syn files....

Just make sure you don't have syn files in Sample or System with the same name (or you could perhaps have conflicts)

Hope that helps
Mournblade
Posts: 9
Joined: Thu Jun 26, 2003 11:31 pm
Location: Middlesbrough, England

Post by Mournblade »

Just make sure you don't have syn files in Sample or System with the same name (or you could perhaps have conflicts)
That was my problem!!
Post Reply