I've used other editors with simple configurable folding modes, including this 'use the level of indentation' one.
Like you, I find it disappointingly limited, & never really used it in anger. I can't remember if I've mentioned Origami, the old Transputer Development System's (DOS-based) editor. It had a wonderful implementation and key binding for code folding. On Wednesday, August 12, 2020 at 12:04:43 AM UTC+1 Edward K. Ream wrote: > On Tuesday, August 11, 2020 at 5:28:44 PM UTC-5 Edward K. Ream wrote: > > > The code is a labyrinth...It's time for a break. > > I googled "vs code folding" and found this manual page > <https://code.visualstudio.com/docs/editor/codebasics#_folding>, > containing this quote: > > QQQ > Folding regions are by default evaluated based on the indentation of > lines. A folding region starts when a line has a smaller indent than one or > more following lines, and ends when there is a line with the same or > smaller indent. > > Since the 1.22 release, folding regions can also be computed based on > syntax tokens of the editor's configured language. The following languages > already provide syntax aware folding: Markdown, HTML, CSS, LESS, SCSS, and > JSON. > > If you prefer to switch back to indentation-based folding for one (or all) > of the languages above, use: > "[html]": { "editor.foldingStrategy": "indentation" }, > QQQ > > This explains a lot :-) It's a disappointingly simple strategy, one that I > never would have considered. Or maybe it's just a brilliantly simple > strategy. Hehe, probably not. It creates too many folding units. They > don't matter much in vs code, but they would not be welcome in Leo. Leo's > importers can't use this strategy. > > *Summary* > > Today's explorations have been useful. They have taught me vs code's > searching capabilities. > > vs code's documentation explains the clever way that vs code discovers > folding units. It is independent of language! > > Alas, this clever approach will be of no use to Leo's importers. Imo, the > importers must know more about language syntax than indentation. I plan no > further explorations in this area. > > Edward > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/86678d68-2a91-4a67-970b-cd445426c725n%40googlegroups.com.
