-1

I'm stuck in defining my language in Notepad++ for syntax-highlighting. I would like to define different colors for different output files that i get from a software. The usual string is:

@--MESSAGE ssksjdjsksl
@ kdkdkdkdkdk
@ kdkdjdj
   23 ghgjgh
@--ERROR ffjjfkfk
@ djdjdj

@--WARNING SJSJ
@ djdjdjdj

What i would like is that Notepad++ recognize the type of string (MESSAGE or ERROR or WARNING) and color the line till it found the @ symbols, and go back to normal when the @ symbol disappear. If possible, it would also use a different color for each message type.

I tried with the delimiters but there isn't an unique character that exit the message, so I don't know where to go from here.

1

You cannot achieve this thing with User Defined Language in Notepad++. Most advanced users can achieve this by modifying Notepad++ source files and adding own lexer there.

However, there is a workaround which might (or might not) help you:

Define highlighting of the following symbols:

@--ERROR
@--WARNING
@--MESSAGE

You can assign different color (or better: different background color) to each. These highlights will catch your eyes as message starting points.

Additionally you can make words like error appear in red anywhere in text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.