Page 1 of 1

how to get notepad++ to ignore part of AutoHotkey syntax?

Posted: 09 Jan 2022, 19:57
by newcod3r
I have this issue. When writing code that resembles commenting out without closing it, the rest of my code becomes comments instead of being recognized properly.

E.g.

Code: Select all

myfunction("abc.com/xyz/*")
all other code below turns into 1 color because it recognizes /* as a comment out 
How do I prevent that from happening while still allowing notepad to recognize the other AutoHotkey syntax?

Re: how to get notepad++ to ignore part of AutoHotkey syntax?

Posted: 09 Jan 2022, 20:08
by sofista
Try this:

Code: Select all

myfunction("abc.com/xyz/*")
all other code below turns into 1 color because it recognizes /* as a comment out ; */

Re: how to get notepad++ to ignore part of AutoHotkey syntax?

Posted: 09 Jan 2022, 20:23
by newcod3r
thanks for the workaround! I was thinking if there's a more permanent solution, like modifying the style to take account of all these exceptions. Another common one I encounter is when the function ends with a )") as such:

Code: Select all

:X:;cm::myFunction("
(bla
1
2
3
4
5
)")
; everything below turns into 1 color again

it believes I did not have a valid open brace to match the close brace, but adding a comment with a fake open brace didn't help.

Re: how to get notepad++ to ignore part of AutoHotkey syntax?

Posted: 09 Jan 2022, 22:47
by sofista
This seems to work:

Code: Select all

 :X:;cm::myFunction("
(bla
1
2
3
4
5
)") ;"
; everything below turns into 1 color again

Re: how to get notepad++ to ignore part of AutoHotkey syntax?

Posted: 09 Jan 2022, 23:46
by newcod3r
this did the job, thanks!

just one last question - is there a proper way to migrate all style settings from 1 PC to another? I copied the entire themes/styles folder in notepad++ but my ahk syntax coloring is still off on my other PCs.

Re: how to get notepad++ to ignore part of AutoHotkey syntax?

Posted: 10 Jan 2022, 08:53
by sofista
You're welcome. From your words, I assume you have installed versions of Notepad++ —it would be easier to copy a portable version—.

Probably you forgot to copy this other file "C:\Users\xxxxxxx\AppData\Roaming\Notepad++\functionList\overrideMap.xml".

Now, to simplify things and without taking into account security or data confidentiality issues, the best thing to do would be to copy the entire folder "C:\Users\xxxxxxx\AppData\Roaming\Notepad++\" to the other PCs.

Re: how to get notepad++ to ignore part of AutoHotkey syntax?

Posted: 10 Jan 2022, 20:02
by newcod3r
sofista wrote:
10 Jan 2022, 08:53
You're welcome. From your words, I assume you have installed versions of Notepad++ —it would be easier to copy a portable version—.

Probably you forgot to copy this other file "C:\Users\xxxxxxx\AppData\Roaming\Notepad++\functionList\overrideMap.xml".

Now, to simplify things and without taking into account security or data confidentiality issues, the best thing to do would be to copy the entire folder "C:\Users\xxxxxxx\AppData\Roaming\Notepad++\" to the other PCs.
I see! Let me try this method, hopefully it works. Thank you. 🙏🏼