mfontanini / presenterm

A markdown terminal slideshow tool
https://mfontanini.github.io/presenterm/
BSD 2-Clause "Simplified" License
1.19k stars 29 forks source link

Code blocks are not wrappable #289

Closed DrunkenToast closed 1 month ago

DrunkenToast commented 2 months ago

Long text is currently not supported with code blocks, they won't wrap properly as the characters are styled but it wraps after the styling is done. Preferably it would be wrapped before the styling is applied.

image


Expected outcome (mind the line numbers).

image


I would understand a "Won't fix" label, since styling like this can be a whole can of worms, and ultimately the writer can simply split up the lines himself.

This would however make it easier to present on different screen sizes (especially considering you can create columns) and make line numbers a bit more convenient.

mfontanini commented 2 months ago

This is something I'm aware of. Like you say, this could open up a can of worms. Also, in the way this is implemented, highlighting happens during presentation load time so it's not as easy as it sounds to do the wrapping because you only know where the end should be once the presentation is being displayed (as you need to know the window/rect size). I do see the issue though, so I'd like to have a look. It's just not as simple to fix as you'd imagine it should be unless things get moved around quite a bit.

DrunkenToast commented 2 months ago

so it's not as easy as it sounds to do the wrapping

Oh no, don't get me wrong, it sounds terribly difficult! Working with text is hell-ish!

Just wanted to open this issue so it's being tracked/people can propose solutions :)