Semi fold does not show code for blocks with less than X lines
Hi there, the issue i'm seeing is:
- Enable
Inverse Fold behavior - Enable
Enable semi-fold(only the first checkbox of the two) - Set number of
Enable semi-foldlines to5 - Create a code block with only 3 lines of code
- Observer that all the code is collapsed and nothing is visible
I would expect to see the 3 lines ?
Please advise :-) Thank you!
screenshot preview...
screenshot edit...
screenshot settings...
It is actually correct :) Look here: https://github.com/mugiwara85/CodeblockCustomizer?tab=readme-ov-file#semi-fold If you set the visible lines to 3, then your code block must have at lesat 3 + 4 lines. The 4 lines is basically the fade-out effect. So your code blocks are fully collapsed because they do not meet the criteria to be able to semi-folded.
Thank you for clarifying @mugiwara85 , okay i see;
Wouldn't it make more sense to unfold (show all lines) in these cases, instead of fold (showing 0 lines) ?
Because basically now it means that the first lines of these very short code snippets can never be shown. So I'd have to manually unfold every single one to at least see something...?
Well, yes and no. So the basic folding is just hiding all lines. Semi-folding is basically just an addition to that so you can display the last 4 line "fading out". If a code block can't be semi-folded, but you either specified "fold", or "inverse fold", than this means that the code block should be folded. But since it doesnt meet the requirements it is being folded normally. I could add an option something like "Do not fold code block if it does not meet semi-fold requirements". When this would be enabled, your 3 line code block would not be folded at all. Would this be ok for you?
Great, sounds perfect. Thank you!
PS. the link to "Contributing & Support" in the readme does not work 😉
https://github.com/mugiwara85/CodeblockCustomizer#contributing--support should be: https://github.com/mugiwara85/CodeblockCustomizer#contributing-support
Ok, I will implement this before the next release. Shouldn't be a big deal.
Thanks, I probably just mistyped it. I fixed it!
@notDavid I added the option. It is under Folding Settings, and is called "Only apply inverse fold to semi-foldable blocks". It is only visible, when inverse fold, and semi-fold are both enabled. If you want to test it, jsut take the current main.js and styles.css and overwrite yours with it.
Hi @mugiwara85 , great it seems to be working 👌🏼
Thank you for the quick solution!