Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code folding #197

Open
wunditta opened this issue Feb 21, 2023 · 5 comments
Open

Code folding #197

wunditta opened this issue Feb 21, 2023 · 5 comments
Labels

Comments

@wunditta
Copy link

wunditta commented Feb 21, 2023

The code folding seems flawed. When folding e.g. level 4 I would expect to collapse all text of level 4 headings (i.e. all h5 and below headings are hidden), but see the h4 headings (without text) and h3 and higher headings with text. This is only partly the case, as some h3 and h2 headings are hidden too (the levels are only examples, the issue is true for any level).

Example: Open the page "Microsoft Windows" on Wikipedia and Fold level 4. The last heading shown is "Platform support" (h4). But when you unfold this heading then there are several h2 and h3 headings below, which were hidden. This issue does not only occur for the last heading.

It seems to me that higher level headings (e.g. h2, h3, h4) are hidden if they are after a collapsed heading (e.g. h5).

tosher pushed a commit that referenced this issue Feb 23, 2023
@tosher tosher added the bug label Feb 23, 2023
@tosher
Copy link
Owner

tosher commented Feb 23, 2023

Please check the new version
https://github.com/tosher/Mediawiker/releases/tag/v3.6.14

@wunditta
Copy link
Author

Thanks, it seems to work now...
... although I must admit I am not sure if I understood the full intention behind the whole folding/unfolding thing. Very likely I am wrong, but this is how I would expect the behavior:

Fold X: I'd expect that all headings from X and higher are folded, all headings less than X are unfolded. This is partly the case. Fold 3 does this. But when I do a fold 4 or 5 afterwards, nothing happens. So only the first part of the expected behavior is true, but headings < X are not unfolded. I might think that it would make more sense to do something (unfolding < X) than nothing happens. Because of this you now have to Unfold all and then Fold again (e.g. Fold 3, Unfold all, Fold 4).

Unfold X: I expected it may unfold >= X (but was not hoping any more it would fold < X ;-) ). But after some tests, as I understood it, the behavior is like this: In a fully unfolded tree nothing happens. If it is folded, e.g. Fold Y=2 and then a Unfold X=4 will unfold all headings (so from Y to 5) for any Y branch of the heading hierarchy where there is a heading X below Y (so the whole branch is unfolded). All Y headings will stay folded if this is not the case. If this is intended behavior I must admit I am not aware of the use case this is needed (but that doesn't mean anything).

Sorry, for this complicated post. Just ignore it, if it went too far. The current behavior is good to live with :-). Thanks again!

@reagle
Copy link

reagle commented Mar 1, 2023

BTW: How do we fold tags, as mentioned in the readme? When I "fold text blocks" it folds the contents of templates, but I don't see tags...?

@tosher
Copy link
Owner

tosher commented Mar 5, 2023

Headings foldling/infolding is the same as level-folding in Sublime text

https://docs.sublimetext.io/reference/commands.html#fold-by-level

Tags - like pre, source and other non-inline blocks.

@reagle
Copy link

reagle commented Mar 6, 2023

Oh, I thought this could be used to fold tags, but those are inline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants