Using the word ‘then’ in a comment will always cause the editor to create a fold. When you close said fold you may have some trouble opening it back up again. This shouldn’t be the case - regular single line comments do not require folds; they’re a single line.
There are other issues with the editor regarding folding, such as ‘elseifs’ folding away more script than it needs to or not folding anything at all, I think it stems from the fact that the word ‘then’ automatically creates a fold regardless of if it’s needed.
It’s been a few months now and this is still an issue.
I think what is happening is that the last ‘then’ will fold everything up until the first end is found (even if it’s in a comment), and if there are multiple 'then’s between the first and the ‘end’ operator, the latter will just override all of them making them completely obsolete, rather than folding the script between the two 'then’s if that makes sense.
It would be expected that a script like:
if (i == 1) then print("1") elseif (i == 2) then print("2") elseif (i == 3) then print("3"); else print("4 or 5"); end;
would fold like this:
Expected Fold Behaviour
if (i == 1) then elseif (i == 2) then elseif (i == 3) then else
not like this.
Current Fold Behaviour
if (i == 1) then print("1") elseif (i == 2) then print("2"); elseif (i == 3) then
**Edit. The word do does this too even if it’s part of a string.