Refined-github: `show-whitespace` causes lines to wrap

Created on 11 Sep 2020  路  9Comments  路  Source: sindresorhus/refined-github

When RefinedGithub is enable, diffs and other views are doing line wrapping on code. I would like to disable this behavior. I searched around the open/closed PRs, as well as through the options for "wrap" but couldn't find this option.

Thanks!

bug good first issue help wanted

All 9 comments

Where are you seeing the code wrapping? Post a link and/or screenshot as requested by the template

Disabled:

Screen Shot 2020-09-16 at 9 25 57 PM

Enabled:

Screen Shot 2020-09-16 at 9 26 11 PM

Oddly, the text file seems to always wrap.

This is also on Github Enterprise; version 2.19.6

Post a link and/or screenshot as requested by the template

The template for "Feature request" doesn't ask for that, fyi.

Thanks for the screenshots, but without a URL now I have to recreate your condition, making it harder for us to find the issue.

The template for "Feature request" doesn't ask for that, fyi.

It does ask for a URL:

  1. Include a full URL where the feature should appear.

It happens under a PR diff view, something like http://our-ghe.com/org/repo/pull/295/files

The wrapping is because of https://github.com/sindresorhus/refined-github/blob/f13db9b420cc351680b15fc86344ad099bd4f96a/source/features/show-whitespace.css#L3 which was added in #3292, to fix another wrapping issue #2991.

It looks like GitHub wraps some file type while it doesn't wrap others. Is this easily detectable? Perhaps that white-space only needs to be applied to some filetypes.

Wrap.md: https://github.com/discord/discord-api-docs/commit/79e7e2894e268c27d11e55d009bf00f020395d64
No-wrap.js: https://github.com/sindresorhus/refined-github/commit/4cb59bea8b78a2d3b8ea4fa888df5e70ca286ff4

Seems like there's a div in the chain that adds .soft-wrap which adds this for files which GH thinks should be wrapped.

I'm thinking this should be easy fix, haven't tested, might be wrong.

[rgh-observing-whitespace] {
    // other props
}

.soft-wrap [rgh-observing-whitespace] {
    white-space: break-spaces;
}

GitHub is likely wrapping files that it thinks don't have code in them, again, I might be wrong.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Arcanemagus picture Arcanemagus  路  3Comments

Celthi picture Celthi  路  3Comments

alexanderadam picture alexanderadam  路  3Comments

yakov116 picture yakov116  路  3Comments

shivapoudel picture shivapoudel  路  3Comments