Sublime Forum

SublimeText 3 Code Folding errors

#1

I am writing code in a file with the extension .awk, whose code folding should be identical to C.

  • I have not tried to assign this to my files … which I should check …
  • I have found the required syntax colour as C, issue resolved. :blush:
  1. I am including an image of my file with incorrect or missing code-folding in red and correct code-folding in green.
    – I think that this is a bug

I started looking at this, as I wanted to pick a block and text and do a manual fold, to just shrink that block of code on the page, to make it smaller

Solved with Package Origami: - Do you have the capability of doing horizontal page splitting of a single file, I am using the multiple horizontal, issue resolved. panes.:blush:

Thanks in advance

0 Likes

#2

I don’t know all the answers. But for the first block, the folding happens at the end of the comment because Code folding works based off indentation. If you indented all your comments to align with your code. It would work as expected

0 Likes

#3

Hi SecEng,
I would agree with you in general that indentation is a good idea.

In this case, the indentation is working as-is for half of the items, 2 are functions at the same level of indentation, yet the first works, yet the 2nd fails. If the 1st indentation consumed both, then I would say the indentation is required.

The string parsing structure again works for 1 and not the other.

I have found that for a code-fold to work for a function, it must be more than 1 line of code – added a comment and that is folding now. This is also without an indent, for both functions …

I leave the rest for you to comment on.

0 Likes