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

Wrap code in comments #1908

Closed
fregante opened this issue Apr 3, 2019 · 10 comments · Fixed by #1989
Closed

Wrap code in comments #1908

fregante opened this issue Apr 3, 2019 · 10 comments · Fixed by #1989
Assignees
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt

Comments

@fregante
Copy link
Member

fregante commented Apr 3, 2019

Issuehunt badges

GitHub is inconsistent. Code wraps in PR/commit diffs, but not in comments:

PR (wraps)

Review comment (no wrap)

Code block in comment (no wrap)

IssueHunt Summary

notlmn notlmn has been rewarded.

Sponsors (Total: $80.00)

Tips

@notlmn
Copy link
Contributor

notlmn commented Apr 3, 2019

GitHub is inconsistent. Code wraps in PR/commit diffs, but not in comments:

To be frank, it is. They do not wrap content if the code is shown in unified view (like code comments in a PR "conversation" view, example), but wrap content in the split view (example).

Because not wrapping content in the split view would cause a lot of problems, impossible actually, because both the left and right parts of the diff are contained in a single tr element, making it impossible to isolate scrollbars for left and right diff views.

Even if you did "unwrap" the lines, then there would be scrollbar for each line in the diff.

Wrapped code (in split diff view, even for comments)

image

Non wrapped code (in unified diff view, even for comments)

image

@sindresorhus
Copy link
Member

making it impossible to isolate scrollbars for left and right diff views.

Not impossible. Just difficult.

@sindresorhus
Copy link
Member

I so want this. I hate not having soft-wrapping everywhere.

@sindresorhus
Copy link
Member

@bfred-it Did you send a feature request to GitHub?

@fregante
Copy link
Member Author

@bfred-it Did you send a feature request to GitHub?

I didn't

@notlmn
Copy link
Contributor

notlmn commented Apr 18, 2019

making it impossible to isolate scrollbars for left and right diff views.

Not impossible. Just difficult.

Yup, it's difficult. But is it worth it? (That was about unwrapping code in split view anyway, not related to this issue)


I so want this. I hate not having soft-wrapping everywhere.

Wrapping of code in unified diffs?

@sindresorhus
Copy link
Member

Yes, but I’d be happy to have just the code in comments wrapped.

@IssueHuntBot
Copy link

@IssueHunt has funded $80.00 to this issue.


@jerone
Copy link
Contributor

jerone commented Apr 22, 2019

I've been using the "GitHub Toggle Code Wrap" UserScript for long time now: https://greasyfork.org/en/scripts/18789-github-toggle-code-wrap

It will add an button to switch code wrapping.

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels May 24, 2019
@IssueHuntBot
Copy link

@sindresorhus has rewarded $72.00 to @notlmn. See it on IssueHunt

  • 💰 Total deposit: $80.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $8.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt
5 participants