sindresorhus/refined-github

No word wrap in 'Suggested change' diffs in PR reviews #4337

darkred posted onGitHub

<!-- 1. Make sure your requested feature makes sense for Refined GitHub: https://github.com/sindresorhus/refined-github/issues/2960 2. Include a REAL URL where the feature should appear. e.g. Do you want a feature to appear on the main page of a repo? Paste a link to a repo -->

I've noticed in PR reviews, that 'Suggested change' diffs are displayed with word wrap. The word wrap is applied by GitHub itself.

I believe it would be more convenient if there was no word wrap, but a scrollbar, to easier spot the differences between the lines. In other words, to be just like it's on linked diff to the upper part of the screenshot:

Example URL: https://github.com/sindresorhus/refined-github/pull/4336#discussion_r628897301

Screenshot: 2021-05-09_185458


Had this same issue many times! I happen to love this idea but would like a check box 'Wrap Diff' since this can VERY annoying in many cases.

It would be as simple as removing the .soft-wrap class

posted by yakov116 almost 4 years ago

For reference, there is this script by @Mottie, GitHub Toggle Code Wrap, which does exactly that feature, with a toggle icon, but doesn't apply to "Suggested Change" diffs.

Based on that script, a simple workaround would be this CSS rule:

.js-suggested-changes-blob td.blob-code-inner:not(.blob-code-hunk) {
    white-space: pre !important;
    word-break: normal !important;
}

I agree of course that having a toggle checkbox would be essential.

posted by darkred almost 4 years ago

We actually used to have a feature that would apply softwrapping like that everywhere I think

posted by fregante almost 4 years ago
posted by yakov116 almost 4 years ago

Fund this Issue

$0.00
Funded

Pull requests