Page 1 of 1

Highlight lines when there are if winactive on notepad++?

Posted: 23 Jan 2021, 00:48
by milkygirl90
My script is getting long and I'm trying to find a way for better readability. Is there a way to highlight a line when it finds:

Code: Select all

 #If WinActive(

Re: Highlight lines when there are if winactive on notepad++?

Posted: 23 Jan 2021, 01:37
by Spawnova
Hmm, this is a good question, I've never thought about it, but after some research I've found a solution for the most part.. I couldn't figure out a way to match spaces so it either highlights a line with #if or with WinActive.

From the menu bar > Language > User Defined Language > Define your language...

This will open a new window, from here select AutoHotKey as your User Language, click Operators & Delimiters tab and in any available Delimiter style put this information in:

Open: #if
Escape: leave this blank
Close: ((EOL))

Click the styler button as well to change the background/foreground color

Here's an image with visuals - https://imgur.com/a/XVWAW6Z

Re: Highlight lines when there are if winactive on notepad++?

Posted: 23 Jan 2021, 14:05
by sofista
I haven't used myself, but there is an Enhance UDL lexer, described here https://community.notepad-plus-plus.org/topic/17134/enhance-udl-lexer/32, which could be of help.

Re: Highlight lines when there are if winactive on notepad++?

Posted: 06 Mar 2021, 20:37
by milkygirl90
Spawnova wrote:
23 Jan 2021, 01:37
Hmm, this is a good question, I've never thought about it, but after some research I've found a solution for the most part.. I couldn't figure out a way to match spaces so it either highlights a line with #if or with WinActive.

From the menu bar > Language > User Defined Language > Define your language...

This will open a new window, from here select AutoHotKey as your User Language, click Operators & Delimiters tab and in any available Delimiter style put this information in:

Open: #if
Escape: leave this blank
Close: ((EOL))

Click the styler button as well to change the background/foreground color

Here's an image with visuals - https://imgur.com/a/XVWAW6Z
this is odd. I already loaded the language and used your delimiter settings but no styling was applied to my script at all. any idea why?
https://i.imgur.com/6O19LtZ.png

https://i.imgur.com/YZ10t34.png