User Defined Language coloring whole line

  • I defined User-defined language for notepad++ , that colors ‘Error’ in red while colors ‘Note’ in blue .
    Can I make it colors the whole line that contains the word ‘Error’ ?
    For example I have this line :
    “Error : initialized Failed!”
    I now get it with red ‘Error’ whereas the rest of the line in the default color ,
    can I get the whole line in red color ? All the lines that contains the wrod Error regardless the position of the word ‘Error’ ?


  • You could define Error as the prefix for single-line comments, which would allow the whole line to be colored.

    But that wouldn’t help if you really wanted “Error.$" in red and "Note.$” in blue.

    Some months back, @Claudia-Frank made some posts on a PythonScript-based lexer, as an alternative to the builtin UDL lexer, which allows defining styles based on regular expressions. I’ve never tried to use them, but in September, at the end of this other thread, I compiled a list of links to her posts about it. I’ve never tried implementing a regex-UDL using her solution, but it may be worth trying out – I’d recommend giving it a try.

  • @Raghad-Qu

    The current pythonscript plugin has even an example which looks like is what you are looking for.


Log in to reply