mugiwara85 / CodeblockCustomizer

Codeblock Customizer plugin for Obsidian
MIT License
147 stars 7 forks source link

[Bug] bug in simi-fold #73

Closed 7Codez closed 4 months ago

7Codez commented 4 months ago

Why if one line it is not appear like simi-fold.

and Can you add an option to make it always collapsed instead of calling it every time?

mugiwara85 commented 4 months ago

Which line is not semi-folded? What do you mean by always collapsed? There is an option fold, which when you define, then the code block appears folded when you open a note. Is this what you mean?

7Codez commented 4 months ago

Glitch occurs in different mode Editing view Screenshot_20240211-145950_Gallery

Live preview Screenshot_20240211-150012_Gallery

Reading view Screenshot_20240211-150022_Gallery

*in setting I choced 2 line to appear.

mugiwara85 commented 4 months ago

Did you read the README? It is clearly written: "If your code block does have the minimum required line (count of visible lines + 4 for fading effect), then it will semi-fold." You one-line code block will not semi-fold because it contains only one line. To make semi-fold work, you'll need a code block with at least that many lines you selected+4 lines. So if you chose 1 line, then it means, your code block must contain at least 5 lines.

7Codez commented 4 months ago

Yes but In these screens, I chose 1 line. You can write this text in Obsidian from your own and your page will appear like the screens.

Copy this text:

1 why?
1
2 if five line
3
4
5

*in setting I choced 1 line to appare.

mugiwara85 commented 4 months ago

I am not sure I understand the problem. Currently there is a small difference between editing and reading mode, which is also documented in the README: "There is a slight difference between editing mode and reading mode. In editing mode the first line of the code block (where you define the language and the parameters) also counts, in reading mode not, since it doesn't exist. This will probably change in the next release so it is the same between editing and reading mode." Is this what you mean? Other than that, as I explained earlier, for semi-code to work, the code block needs to have (the selected lines(in your case 1) + 4 lines), so in your case at least 5 lines. If it has less then 5 lines, it will fold normally. As I am not sure what problem you have, you might want to switch notes once, after you switched to reading view. Otherwise, please describe the problem in much more detail.

mugiwara85 commented 4 months ago

no more reply received