Skip to content

Wrap code in comments #1908

Closed
Closed

Description

@fregante

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

Activity

  1. notlmn commented on Apr 3, 2019

    @notlmn
    Contributor

    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

  2. sindresorhus commented on Apr 18, 2019

    @sindresorhus
    Member

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

    Not impossible. Just difficult.

  3. sindresorhus commented on Apr 18, 2019

    @sindresorhus
    Member

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

  4. sindresorhus commented on Apr 18, 2019

    @sindresorhus
    Member

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

  5. fregante commented on Apr 18, 2019

    @fregante
    MemberAuthor

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

    I didn't

  6. notlmn commented on Apr 18, 2019

    @notlmn
    Contributor

    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?

  7. sindresorhus commented on Apr 18, 2019

    @sindresorhus
    Member

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

  8. IssueHuntBot commented on Apr 22, 2019

    @IssueHuntBot

    @IssueHunt has funded $80.00 to this issue.


  9. self-assigned this
    on Apr 22, 2019
  10. jerone commented on Apr 22, 2019

    @jerone
    Contributor

    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.

  11. added
    💵 Funded on Issuehunt
    on May 10, 2019
  12. added and removed
    💵 Funded on Issuehunt
    on May 24, 2019
  13. IssueHuntBot commented on May 24, 2019

    @IssueHuntBot

    @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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions