Open CareyJWilliams opened 6 years ago
I wonder what the impetus is behind folding on labels? Maybe it's such that simply folding away big blocks of text, i.e. from the label to the next is good enough? (Perhaps ignore comment and certain other commands in this.)
Hi @Flurrywinde, thanks for pitching in on this.
I think the issue here is that ChoiceScript's target audience (and thus CSIDE's) tend to be from a more authorial background (as opposed to a programming one). This probably comes with very different desires/expectations, but I'm unsure exactly what those might be.
Like you said there are a few things we could try, possibly also folding on paragraphs? What I'm most bothered about is avoiding false positives. Written prose doesn't have the structure of a programming language, so most approaches are going to have a risk of presenting undesirable folds.
Well, I guess the best you can do is make it and wait for the complaints. LOL. I would use the K.I.S.S. principle and fold on just text, comment, image, and other simple to detect commands that authors will probably consider part of the label.
I am a programmer, but when I write choicescript, my stories are probably more "authorial" than many pure authors on CoG, i.e. very little code other than simple *choice's. I'd think the usefulness of folding would be to squash away the narrative parts to be able to see more clearly the choice-tree (and conditionals).
Granted, you might be right that I'm missing what their desire/expectation actually is, but since my suggestion is a. easy to code, and b. has a good chance of being what authors actually want, I'd think it a good place to start. Once something's in place, they will tell you how it should be changed.
Maybe there could even be a settings section for folding, as some authors may not want to fold away comments or images while others would.
One place where your "macro" idea might be handy is if there's an if block that the author wants to consider to be part of the narrative and therefore fold with the label. Perhaps they could then add "comment fold-if" or some such before it, whereas other if's with more complex code probably should not be considered part of the narrative part. Or... if's with only text in their block could be folded automatically (unless they specify not to via the proposed settings section).
Hehehee, or, getting a bit more complicated, have several levels of folding (i.e. the equivalent of indention levels) that starts by folding just a paragraph, then a section of just text (i.e. several paragraphs), then these text sections if separated by only image, comment, etc. But I wouldn't start with this. I'd do it the easiest way first and then see what people say.
Alas, as good as all these ideas are, I don't have the time to investigate them right now.
but since my suggestion is a. easy to code, and b. has a good chance of being what authors actually want, I'd think it a good place to start.
I am however, open to pull requests 👍 :)
I look forward to CSIDE's continuing development as time allows! I'd love to help and will, as health allows, but sadly, I am still in a downturn.
Thank you! Much appreciated, best wishes with your health.
We can't currently fold on labels because there's no formal way to prove where a label ends. This however seems to the primary use-case/desire as opposed to indentation folding, so it may be worth investigating alternative solutions.
E.g. could we use comment fold-start and comment fold-end "macros" to achieve the effect?