Hi Jos,
Not sure if you are wishing for a fix to the comments. But if so:
I added to ~Line 105:
if string.find(editor:GetLine(Parent_line), "^%s*;") then
self:DebugPrint('! Parent Line is a Comment, finding real parent.', "Old Parent line: " .. Parent_line, "New Parent Line: " .. editor.FoldParent[Parent_line])
Parent_line = editor.FoldParent[Parent_line]
end
And to ~line 228, after:
elseif Curr_firstword == "" and Curr_lastword == "" and Parent_line ~= -1 and
string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then
-- Empty line in a fold, update indent to appropriate parent fold level.
editor.LineIndentation[line + 1] = editor.LineIndentation[Parent_line] + editor.Indent
self:DebugPrint('- Empty line in a keyword, update indent to Parent + 1 --', editor.LineIndentation[line + 1])
Added the following:
elseif (string.find(Curr_firstword, "^;") ~= nil) and Curr_lastword == "" then
-- Correct Indent after a comment which may be in the wrong indentation position.
if (Parent_line ~= -1) and
string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then
editor.LineIndentation[line + 1] = editor.LineIndentation[Parent_line] + editor.Indent
self:DebugPrint('- New line after a comment, update indent to Parent + 1 --', "New Indent Level: " .. editor.LineIndentation[line + 1])
else
editor.LineIndentation[line + 1] = 0
self:DebugPrint('- New line after a comment outside of a fold, update indent to 0 --', "New Indent Level: " .. editor.LineIndentation[line + 1])
end
If you're not concerned. You can ignore this.
Best regards,