Allow more Comments in *.syn [Syntax] section

Ideas for new features

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

Post Reply
gesansom
Posts: 3
Joined: Mon May 07, 2007 4:28 pm

Allow more Comments in *.syn [Syntax] section

Post by gesansom »

Hello TextPad developers,

Would it be possible to add the ability for user-defined values in the [Syntax] section of .syn files, specifically for adding more Comment definitions?

For example, you currently list (in Preferences, Document Classes, Colors) Comments and Comments 2. Obviously these refer to CommentStart,CommentEnd and CommentStartAlt, CommentEndAlt respectively. What I'm suggesting here is adding the ability to add CommentStart3, CommentEnd3 ..and so on.

Here's my reason for this suggestion:
G-code is the language used to program CNC controlled devices. It is uniquely different from most programming languages but it does share many common syntax similarities. Where syntax highlighting gets problematic is with the "Keywords" being just one character. I tried using a range similar to "InitKeyWordChars = A-Za-z" but this doesn't work in the [Keywords] sections. I was able to get it to work nicely using the available comments keys in the [Syntax] section by using the space character as the "End" value. Point is, there's more single character keywords in G-code than there's comments.

Perhaps there's a better way, and I just need to be more knowledgeable about this. Here's the simplest method I can suggest if using [Keywords] sections is the solution:

Allow values like P1-P9, P01-P2999, M1-M9, M01-M99, ..and so on. This would highlight the entire "word" associated with the leading character. Currently I'm able to highlight only the leading character using the comments concept.

I appreciate any help, advise, or tips anyone can offer.
Thanks in advance,
Garry
Post Reply