Robert Hicks wrote:
According to the isk help file "-" is a keyword character. I am trying
to update the Tcl syntax file a bit. Tk has lots of options that start
with the "-" character. I was hoping that the above would make it easy
to highlight all of the options without a lot of fuss.
Is it possible to create a keyword group and then do a match with
those words and if they are prefixed with a "-" to color them a
certain way? A couple of the actual ones would be:
-command
-menu
-fill
-pady
-padx
-tearoff
-label
-text
-height
-width
-justify
and the list goes on. And you can see why I was hoping a simple match
would do it. :-)
You can get the effect I think you want with:
syn match OptionMatcher "\%(^\|\s\)\zs-\w\+"
contains=SpecificOptionList,OptionStarter
syn keyword SpecificOptionList contained command menu fill pady padx
tearoff label text height width justify
syn match OptionStarter contained "-"
hi link OptionMatcher Error
hi link SpecificOptionList Statement
hi link OptionStarter SpecificOptionList
These commands will highlight your options; ones that aren't in the
keyword list (ex. -junk) would get highlighted as Error.
Regards,
Chip Campbell