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

Line Wrap to keep on the screen? #320

Open
EventGuyZ opened this issue May 14, 2024 · 9 comments
Open

Line Wrap to keep on the screen? #320

EventGuyZ opened this issue May 14, 2024 · 9 comments

Comments

@EventGuyZ
Copy link

This is probably a stupid question but would love the ability to wrap the code so I can see it on one screen without scrolling all the way to the right. This also makes it easier since the copy code button is also on the far right.

Feels stupid to complain since this is the best code block for Wordpress I've seen. Wish it had code wrap and also wish Buddyboss would allow it to be used on the discussions which will never happen.

@KevinBatdorf
Copy link
Owner

Hey, do you have a link? I can give you some CSS to help with this. It breaks some other features though like line highlighting, so I'm not going to add it to the plugin for now.

You can also see some other conversations on this here: https://github.com/KevinBatdorf/code-block-pro/issues?q=line+wrap

This also makes it easier since the copy code button is also on the far right.

This might be a bug. The button should not be scrolling. If you want to share a link I can take a look at it.

@EventGuyZ
Copy link
Author

EventGuyZ commented Aug 27, 2024 via email

@KevinBatdorf
Copy link
Owner

The plugin is so heavily integrated into the block editor that it just wouldn't be possible. I've have to create an entirely new plugin unfortunately. Doesn't bbpress support the wp editor?

By the way, for line wrapping, if you still need it, a good solution was brought up here: #250 (comment)

@EventGuyZ
Copy link
Author

EventGuyZ commented Aug 27, 2024 via email

@EventGuyZ
Copy link
Author

An example of the issue I'm facing you can see here
https://mywiseguys.com/docs/how-to-create-and-delete-f5-vcmp-guest/

The very first line of code stretches off the screen and I'd prefer how it looks when I'm working on the document which is this
code-pro_keep-all-code-on-screen

Not sure if this is possible but it would be awesome. Like in a terminal you set the max columns, it would be great if we could just set that globally on our site or in the block while editing.

@KevinBatdorf
Copy link
Owner

Did you add the code from the issue I linked to? I think that would solve it.

div[class*='code-block-pro']:not(.x) pre span.line {
	white-space: pre-wrap;
}

CleanShot 2024-09-04 at 22 39 30@2x

Also, you have the language set to JavaScript, which probably isn't what you want? It woulnd't affect the layout, but would the highlighting.

@EventGuyZ
Copy link
Author

EventGuyZ commented Sep 4, 2024

Yea, I was just focused on getting the code to show when I print the page.

EXAMPLE of what it looks like when I try and print the page
codepro_print_truncated-code

I added the CSS code where I thought it would go which is under Advanced when I click on the codeblock and it did not fix. I also cleared cache in case it was no updating because of cache but same result after clearing cache.
codepro_css-code_no-fix

So I must be pasting the code to fix the word wrap in the wrong place

@KevinBatdorf
Copy link
Owner

You would have to add it to your theme css file, or if you're using a block theme with FSE,

https://mywiseguys.com/wp-admin/site-editor.php?canvas=edit

CleanShot 2024-09-05 at 00 39 27@2x

If you're using a classic theme, you have to find the customizer and add CSS there.

@EventGuyZ
Copy link
Author

Sometimes I'm just mentally challenged. Using Buddy X theme and found the add Additional CSS and I added this and its working. Thank You
Custom_CSS_added-NOW_working

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

No branches or pull requests

2 participants