need help with syntax highlighting

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
pathovore
Posts: 3
Joined: Fri Dec 21, 2007 12:06 pm

need help with syntax highlighting

Post by pathovore »

Greets,

okay, so, ...

Image

I am using textpad 4.7.1 with a lua syntax file.... print() and tostring() are apart of the lua language, so they should be highlighted... but, as you can see, I have my own functions set.print() and set.tostring() where those keywords are being highlighted and "set." isn't. The deal is, the whole function name shouldn't be syntax highlighted at all!

So, I want to change the way the syntax highlighting works so that it highlights keywords only when the proceeding character is a space.

so print() gets highlighted and set.print() doesn't [get half highlighted!]

Can someone tell me how to fix this? I checked the help file and tried a variety of things to no avail. Much thanks,

pv
User avatar
helios
Posts: 711
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

A possible work around could be to try adding set.print and set.tostring to Keywords 4 in the syntax file, and then change the Foreground color for Keywords 4 to black.

I hope this helps.
Helios Software Solutions
pathovore
Posts: 3
Joined: Fri Dec 21, 2007 12:06 pm

Post by pathovore »

Yo Helios... don't you know your own editor? Have you actually used Textpad? :) Here's the solution [update your records]

After much angst [including trying other text editors as replacements], I figured out how to fix it in textpad. Under document classes -> lua [or whatever] -> syntax, there is a parameter for "Other characters in words: "... I added a period to this and now the syntax is highlighted as it should be.

This is good... I checked out a few other editors in the meantime and mostly exhibit this behavior but without workaround, so textpad gets points in this respect. [conText editor and notepad++ are 'intelligent' by default].......
CharlesHarrison

Post by CharlesHarrison »

Add each part of the compound word to a suitable Keyword section of your syntax file. That is, not ...

Code: Select all

set.tostring
... but ...

Code: Select all

set
tostring
pathovore
Posts: 3
Joined: Fri Dec 21, 2007 12:06 pm

Post by pathovore »

Charles, that is incorrect, too. I already stated the solution Your method would highlight .....

never.want.to.set.this.tostring()

where 'set' and 'tostring' would be highlighted and the rest wouldn't. Tsk tsk.
Post Reply