Lua code tab / Табуляция lua кода
-
Please tell me the plugin for tab lua code, not as I can not find (x64)
((To level a smooth, ladder)Подскажите пожалуйста плагин для табуляции кода lua, не как не могу найти (x64)
(Что бы выровнять ровненько,лесенкой) -
Can you clarify on what you are looking for in more detail please?
-
how to align the lua code ?
Example:
- it was so
local t = 0
for i = 1,10 do
if t == 5 then
print(t)
else
print(t/t)
end
t = t + 1
endExample:
- need to so
local t = 0
for i = 1,10 do
if t == 5 then
print(t)
else
print(t/t)
end
t = t + 1
end -
Example:
- need to so
local t = 0
for i = 1,10 do____if t == 5 then
________print(t)
____else
_________print(t/t)
____end
____t = t + 1
endI did not know how to write the code in the message so added underscore
-
It appears you are seeking a “Lua code beautifier”? If so, Notepad++ cannot really help you with that.
-
Yes, in the atom editor this plugin is called beautifier ,and in notepad++ I can not find
-
Install LuaScript plugin via Plugin Manager
Edit startup file with something like thislocal decreaseIndentPattern = [[^\s*(elseif|else|end|\})\s*$]] local increaseIndentPattern = [[^\s*(else|elseif|for|(local\s+)?function|if|repeat|until|while)\b((?!end).)*$|\{\s*$]] indent_size = 4 function format_code() editor:BeginUndoAction() current_indent = 0 next_indent = 0 for i=0,editor.LineCount do current_indent = next_indent start_pos = editor:PositionFromLine(i) end_pos = editor.LineEndPosition[i] if editor:findtext(increaseIndentPattern, SCFIND_REGEXP, start_pos, end_pos) then next_indent = next_indent + indent_size end if editor:findtext(decreaseIndentPattern, SCFIND_REGEXP, start_pos, end_pos) then current_indent = current_indent - indent_size next_indent = next_indent - indent_size end print(current_indent) editor:InsertText(start_pos, string.rep(" ", current_indent)) end editor:EndUndoAction() end npp.AddShortcut("Source Code Formatter", "Ctrl+D", function() format_code() end)
More example are seen here
Cheers
Claudia -