3

I want to use syntax highlighting in Notepad++ for a script language that I'm working with. I set up keywords and stuff in "User Defined Language" and pretty much everything works as I'd like it to except for the following:

The script language uses #IF and #ENDIF (just like C), but I can't figure out how to configure Notepad++ so that entire lines starting with #IF or #ENDIF are highlighted (just like it is in C).

Using keywords, only the keywords #IF and #ENDIF are highlighted and not the entire line. Operators & Delimiters doesn't work either since there is no closing delimiter for lines with these statements.

How can this be achieved?

Nassbirne
  • 135
  • 1
  • 8

1 Answers1

3

It can be kludged in as a comment style.

You can do this by defining #IF and #ENDIF as two possible beginnings of a comment line.

enter image description here


An alternate method is to make #IF and #ENDIF delimiters.

enter image description here

The delimiters #IF and #ENDIF just need to have their end markers as the end of the line. The special keyword 'EOL' expands to a vector of three strings: "\r\n", "\n", and "\r"

Samuel
  • 158
  • 5