Prevent soft line-wrap caused by show-whitespace#3851
Prevent soft line-wrap caused by show-whitespace#3851fregante merged 1 commit intorefined-github:masterfrom
show-whitespace#3851Conversation
|
As discussed in that issue, I don't think this is going to be enough #3542 (comment) Can you test it in both the linked files and include a screenshot and URLs you tested like requested by the PR template? |
|
I checked too and it appears to match GitHub’s native wrapping in both cases. Screenshots in order: master, this PR, native GitHub Screenshots in order: master, this PR, native GitHub (here the wrapping is slightly different because tabs are 8 chars instead of 4) (this kind of comparative screenshot is what's needed to visualize and verify the change) |
This screenshot in the middle looks kinda off, if the spaces at the end stay on the same line, we get a scrollbar (intended when there is no If we do not see any scrollbar here in this screenshot then the whitespaces at the end are either getting clipped or collapsed, which I see from screenshots is the same happening with native GH styles (because HTML collapses consecutive spaces by default). Then the question here would be should spaces at the end be collapsed, as per HTML spec, or have spaces preserved and wrapped considering the content as computer code, similar to what VSCode does (see screenshot below)? If we do take stuff around this specific piece of code as context, then the first line here has spaces collapsed, but the second line has it's hypens ( Whereas the first line has its pipe character at the start of the wrapped line. Which brings us back to the same question above if we have to consider spaces as "words" and not collapse them. @gcbw in any case, was #3542 (comment) considered, was anything missing from that? |
|
This feature is If this PR restores the wrapping behavior to exactly how it is without Refined GitHub, then it's correct. In my few tests, it looks like it does. It'd be great to test more views: commits, PRs, unified diffs, split diffs, embedded code links, PR code suggestions, etc. |
show-whitespace
No it was not, as I did not want to delve too much into fixing GH problems. I focused on removing side-effect from GHR instead. The cases i had in mind was regular code, where you actually do scroll left-right as needed, but keep the line flow as intended. Seeing the images that fregant kindly provided, I actually like the "bug" from GH. ...the So I guess it's a win-win to not fix GH bug on this. (still would like to have the option to toggle soft line break as an option for people with small screens though, just do not think whitespace should depend on it as it is now) |
Makes sense.
As the spaces getting collapsed is a "bug" from GH, this PR would be fine. It would be up to the person working on #2729 to make sure that styles don't get mixed up between these features (like cases when one feature breaks when the other feature is not enabled). |
|
Thanks @gcbw! |











Closes #3542
pls, can the reporter test this out with tabs (only had space indented repos handy) and post a screenshot?
I also tested the implied-github-softwrap discussed in the issue by going to #2991 and it seems that is not triggering the same things as discussed in the issue #3542 . As the class name changed here doesn't even apply on that diff.
also, some times forced soft-line-wrap is a desirable feature. Will try to move to it's own setting later on.