You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
Non wrapped code (in unified diff view, even for comments)
Activity
notlmn commentedon Apr 3, 2019
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
trelement, 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)
Non wrapped code (in unified diff view, even for comments)
sindresorhus commentedon Apr 18, 2019
Not impossible. Just difficult.
sindresorhus commentedon Apr 18, 2019
I so want this. I hate not having soft-wrapping everywhere.
sindresorhus commentedon Apr 18, 2019
@bfred-it Did you send a feature request to GitHub?
fregante commentedon Apr 18, 2019
I didn't
notlmn commentedon Apr 18, 2019
Yup, it's difficult. But is it worth it? (That was about unwrapping code in split view anyway, not related to this issue)
Wrapping of code in unified diffs?
sindresorhus commentedon Apr 18, 2019
Yes, but I’d be happy to have just the code in comments wrapped.
IssueHuntBot commentedon Apr 22, 2019
@IssueHunt has funded $80.00 to this issue.
jerone commentedon 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.
IssueHuntBot commentedon May 24, 2019
@sindresorhus has rewarded $72.00 to @notlmn. See it on IssueHunt