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

Discuss features, issues, about Editors for AHK
User avatar
milkygirl90
Posts: 40
Joined: 10 Nov 2020, 21:22

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

Post by milkygirl90 » 23 Jan 2021, 00:48

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(
User avatar
Spawnova
Posts: 456
Joined: 08 Jul 2015, 00:12
Contact:

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

Post by Spawnova » 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
Some of my AHK programs: 3D Voxel Game - Platformer Game - Langton's Ant - Raycast light/Pixel Water - Creating HD map of any game
Or check out my Youtube for these plus many more projects! :D
sofista
Posts: 99
Joined: 24 Feb 2020, 13:59

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

Post by sofista » 23 Jan 2021, 14:05

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.
Post Reply

Return to “Editors”