Page 1 of 1

How to highlight variables with % in Notepad++?

Posted: 19 Jan 2022, 06:54
by BrockPlaysFortnite
Hey guys I have mostly succeeded by now in completely copying my scite4ahk colors over to Notepad++ but the last thing I am missing is the percent sign highlighting.

Here is an example of how scite4ahk treats it:
Image

and here is Notepad++:
Image

First I tried changing the delimiter settings to this
Image

but this breaks all the code if I don't close the percent sign. It seems that Scite makes everything before any % sign blue no matter what but I have no idea what setting I have to change to achieve this 🧐

Re: How to highlight variables with % in Notepad++?

Posted: 12 Apr 2022, 03:25
by Philister
Found the solution here. Just make sure you remove % from the keyword and operator lists in case you have it in there.

Alternatively, if you want different styling options for both uses of %:
1. Define % as a keyword that requires a prefix - this covers your %var% cases.
2. Add % to the operator list in the edit box on the right side (for the operators that must be surrounded by whitespace) - in that way, e. g. in Loop, % expression, at least % is highlighted (with the operator colour), though there does not seem to be a way to highlight the expression as well.

HTH