-
Notifications
You must be signed in to change notification settings - Fork 655
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 wrapping of long code lines #253
Comments
I like it... I'm using it now and I'll report back if I run into any issues. |
The change does not work on encoded images. You can include a .blob-code-inner {
white-space: pre-wrap !important;
word-break: break-all !important;
} |
Hmm, I guess most editors break like |
Looking good so far. The |
There's a bit of horizontal overflow on diffs it seems: silverwind/uppie@00ca357 (view the suppressed diff). Not sure what's exactly causing the overflow here. |
Added |
It's because some td.blob-code-inner {
display: table-cell !important;
} |
Awesome, thanks 👍 |
So far I noticed no issues, I think it's good to go. |
Can we not use it in issue comments request/request#1932 (comment) at least ? That looks kind of funny and it's definitely not easy to read. The code block placed inside an issue is much narrower than the one in the source code view, plus line wrapping makes sense only for certain text types. |
With my current font, the inline block fits 89 characters, which isn't too bad as many people still adhere to 80 character lines. We should at least add an option on userstyles.org for people who prefer no wrapping and I think I'll explore a userscript addon to toggle wrapping. |
That's kind of true but people tend to paste completely random stuff in the comment box. I can still change the style for myself only, but I though that's an actual issue. |
Hey @silverwind, the second line targets code in comments. What is the /* GitHub Bug: Enable wrapping of long code lines */
.blob-code-inner, .markdown-body > pre > code,
.markdown-body > .highlight > pre {
white-space: pre-wrap !important;
word-break: break-all !important;
display: block !important;
} |
something to test:
|
@Mottie can't remember. It's certainly not Gist. I think you can remove it. |
Made a little toggle button for code boxes in Markdown: For it to work, we'd have to reduce above selector to just |
@Mottie the second selector is actually for block with highlighting. Their markup is a bit different from non-highlighted boxes. |
Maybe we should make our "GitHub Dark Script" repository again 😋 |
LOL - I still have the code from when the repository existed. It contains a script to colorize these comment boxes per author (based on their name). |
Yeah, that was hell of a hack :) Actually, I'll see if I can get something more general done. Like a script that can toggle on/off certain sections of the stylesheet, that'd be ideal for something like this wrap thing, but could be expanded to more options. I think a "GitHub Dark" option sub-panel is in order. |
@silverwind Do you think we can close this issue now? 😛 |
I still would like to make the default to not wrap, wanna make that change? (Might require a option flip in the script too) |
Ok, but I won't be able to get it done until later tonight. |
No hurry 👍 |
All done. |
Standalone version for people who prefer wrapping without the script. |
I just pushed a change that enables wrapping of long lines like this one.
So far It seems to work, but there may be side effects and we also need to take care of Gist and other code boxes. We could do an option for it, but I see no downside, so it may be unnecessary.
The text was updated successfully, but these errors were encountered: