Implied folding close
-
I’m working on a UDL for a non-programming language data file, to make it easier to read.
I’d like to be able to fold (collapse) sections of text based on a definite opening string, and the closing string would need to be implied by the presence of the subsequent opening. In other words, the folding close is not always a predictable string, but the opening is.
For example, let’s say that a foldable section will always be identified by a line with the word “foo”, but the lines after that are unpredictable, at least until the next “foo” line. So, a “foo” line would imply "close prior section (if any) and start new section. So I’d like the folding to follow the groupings below. I’m willing to accept the possibility that the final group might not be collapsible, because there would not be a final “foo” to imply the group boundary.
foo
bar
bat
foo
baz
qux
waldo
foo
fred
bar
thud
foo
plugh
baz
bat
barDoes the existing UDL facility allow for something like this?
Thanks!
Jeff
-
@jeff-bowles said in Implied folding close:
Does the existing UDL facility allow for something like this?
Nope, sorry. The UDL folding is pretty simplistic in its logic, and cannot do fancy stuff like that.
-
@peterjones So would I re-frame my question and put it in as a feature request, or is it very difficult to implement something like this?
-
FYI: We in the Forum cannot change the codebase, and the Forum is not the official feature request location.
That said, even if you were to create a feature request in the official location (as described in the FAQ), I doubt it would be implemented. The UDL has not had any significant/meaningful changes in years. (The lack of UDL development is my biggest complaint about Notepad++, because there have been critical known issues, like not handling unicode characters, not allowing pattern matches rather than literals in the keywords and folding, and the other limitations in folding: I’m sure these limitations are chasing away many users, who would actually use Notepad++ if those were fixed/implemented. My long-term hope is that someone will take it upon themselves to write “UDL 3.0” as a plugin-lexer, and re-implement it from the ground up with the modern features, but that’s a huge ask, and something that I don’t yet have the skills or bandwidth to do [and aren’t likely to in the next few years])