Page 1 of 1

Block indentation in Notepad++

Posted: 15 Mar 2021, 22:31
by william_ahk
One thing that pains me the most when writing AHK scripts in Notepad++ is that there's no block indentation when pressing enter in the middle of a new pair of curly brackets. Is there any way to implement this feature in Notepad++?
no_indentation.png
no_indentation.png (973 Bytes) Viewed 4483 times
expected_indentation.png
expected_indentation.png (1.11 KiB) Viewed 4483 times

Re: Block indentation in Notepad++

Posted: 18 Mar 2021, 21:09
by boiler
I’m sure you’ve considered this, but you could avoid that pain by switching to an editor that handles things like that (and much more) such as Visual Studio Code. I tried Notepad++ for AHK for a while, among others. Once I tried VSCode, I’ve stayed with it.

Re: Block indentation in Notepad++

Posted: 03 Sep 2021, 05:29
by william_ahk
After a lot of research I still can't find any solution, so I wrote an AHK script to get by:

Code: Select all

#IfWinActive, ahk_class Notepad++ ahk_exe notepad++.exe
:X`n:{::
SendInput {{}{Enter 2}{}}{Up}{Tab}
#If
If anybody knows how to implement this in udl it would be greatly appreciated!

Re: Block indentation in Notepad++

Posted: 28 Nov 2023, 04:26
by Guest
william_ahk wrote:
03 Sep 2021, 05:29
After a lot of research I still can't find any solution, so I wrote an AHK script to get by:

Code: Select all

#IfWinActive, ahk_class Notepad++ ahk_exe notepad++.exe
:X`n:{::
SendInput {{}{Enter 2}{}}{Up}{Tab}
#If
If anybody knows how to implement this in udl it would be greatly appreciated!
I came here looking for the same thing. My solution was just to set the language to C++. I don't know why Auto-indent doesn't work with user-defined languages.