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

feat: handle code overflow #320

Merged
merged 1 commit into from
Aug 2, 2024
Merged

feat: handle code overflow #320

merged 1 commit into from
Aug 2, 2024

Conversation

mfontanini
Copy link
Owner

This makes it so that code blocks don't overflow to the right of the code block but instead how you'd expect them to: by creating a new line within the code block rect, properly colored and stuff.

image

Fixes #289

cc @DrunkenToast can you give this a shot? It seems to work well including line counts and all.

@DrunkenToast
Copy link
Contributor

Woah, awesome! Didn't expect for this to be here so soon.

I did manage to break it however.
I am fairly sure this is simply because of the padding not being taken into account/incorrectly. Especially since it doesn't happen with output lines where there is no padding.

Examples:

Too small, goes outside box (2x padding):
image

Slightly too small, goes inside padding (1x padding):
image

Simply too much text (2x padding):
image

@mfontanini
Copy link
Owner Author

Nice, thanks! I see the issue, I'll need to shuffle some things around. Weird that I resized the screen so many times and never saw this.

@mfontanini
Copy link
Owner Author

Alright this is fixed. The only outstanding minor issue is when you shrink the window enough, the text will hit up to the code box's border. e.g. there won't be a 2 space padding at the end (see the the first long long... line in your first image). I can address this separately tho, as it's a smaller issue and this has been a bit of an annoying change.

@mfontanini mfontanini marked this pull request as ready for review August 2, 2024 13:06
@mfontanini mfontanini merged commit fb53aa0 into master Aug 2, 2024
6 checks passed
@mfontanini mfontanini deleted the feat/code-overflow branch August 2, 2024 13:06
mfontanini added a commit that referenced this pull request Aug 20, 2024
This fixes a styling issue leftover from #320 where there was no padding
being applied to the right of wrapped code block lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code blocks are not wrappable
2 participants