GitHub bug: tabs are missing 2 characters in diffs
See original GitHub issueI think that GitHub changed markup for diff UI containing diff markers. Right now markers are being hidden using visibility: hidden
(link), but we may need to use display: none
.
This fails when the first character of the line is a tab, in which case it gets collapsed. This can be clearly seen code starting with spaces (demo).
And yes, using display: none
on the pseudo elements did fix this for me, for code indented with tabs and spaces.
Test
- PR diff: https://github.com/sindresorhus/refined-github/pull/3051/files#diff-3607e5002f8b54915e7c24d1741d078bR1-R4
- Compare UI: https://github.com/sindresorhus/refined-github/compare/clean-notifications?expand=1
Screenshot
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
GitHub bug: tabs are missing 2 characters in diffs · Issue #3052
I think that GitHub changed markup for diff UI containing diff markers. Right now markers are being hidden using visibility: hidden (link), but...
Read more >Tabs in diffs are not rendered correctly · Issue #8616
Steps to reproduce the behavior · Modify anything, be sure that the modified line should begin with a tab character · See diff...
Read more >About comparing branches in pull requests
Pull requests display diffs to compare the changes you made in your topic branch against the base branch that you want to merge...
Read more >tabs disappeared · Issue #80319 · microsoft/vscode
// Controls whether the diff editor shows changes in leading or trailing whitespace as diffs. "diffEditor.ignoreTrimWhitespace": true,. // ...
Read more >Installation fails · Issue #322 · databus23/helm-diff
It resolves multiple urls from the GitHub api, but treats them as a single url, causing the Illegal characters found in URL message....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Perhaps it’s better to open a new, clearer issue for a feature request. Can you open it?
This is likely happening because the line (as far as the browser is concerned) includes the diff signs and the space after it. That’s 2 extra characters that shouldn’t be there.
I don’t know if there’s an easy way to convince the browser to start after the diff signs. My guess is that a block element resets the tabulations.
Maybe we can fix their bug, maybe not. Either way I suggest reporting it to GitHub: