use plugin from macro
-
I’m currently using the addon “indent by fold” to indent my lua code, however is indents lines that begin with ‘else’ incorrectly so i wrote a macro that fixed these mistakes with a regex replace.
This means that i have to click 2 buttons to indent my code, which is annyoing does anyone know how i can extend my macro to call ‘indent by fold’ first?
-
to be honest - if you are programming lua why don’t you use the
lua script plugin from dail and program your own indent routine or better check out his examples as far as I remember there was already an indent functionality developed?!Cheers
Claudia -
I believe you are talking about this posting?: https://notepad-plus-plus.org/community/topic/12741/auto-identation-in-lua-code-language
-
Thx to both of you, this was quite helpful.
-
-
Thx again, i noticed though that the script cannot currectly indent functions that are passed as parmeters to other functions, in particular LuaAutoIndent.lua cannot correctly indent itself since it contain multiple lines like
npp.AddEventHandler("OnSwitchFile", function(filename, bufferid)
also it doesn’t indent correctly after the lineif editor:findtext(increaseIndentPattern, SCFIND_REGEXP, start_pos, end_pos) then
this is becasue theend
inend_pos
-
I never said it was perfect ;) You are welcome to make changes and submit a pull request.