Repository navigation
Description
Explanation
This is a restriction of tab characters being collapsed to nearest tab point because of that extract character at the start of the line.
Here is an example:
$ git diff master
diff --git a/source/refined-github.css b/source/refined-github.css
index 8d7a559..3d8cdd5 100644
--- a/source/refined-github.css
+++ b/source/refined-github.css
@@ -114,3 +114,22 @@ pr-branches
.js-issue-row .text-small.text-gray {
line-height: 1.8;
}
+
+/* Removes redundant user/repo from notifications when being grouped by repository */
+/* Place discussion number before the title */
+.js-notifications-group [id^='notification'] {
+ flex-direction: row !important;
+}
+/* Hide duplicate repository URL */
+.js-notifications-group [id^='notification'] > .d-flex > .f6 {
+ font-size: 0 !important;
+}
+/* Size and position the discussion number */
+.js-notifications-group [id^='notification'] > .d-flex > .f6 > span {
+ display: block;
+ font-size: 12px;
+ font-variant-numeric: tabular-nums;
+ margin-top: 2px; /* Align baseline with discussion title */
+ margin-right: 8px;
+ word-break: keep-all;
+}Here Git renders a tab character with 7 spaces, 1 for the marker at the front. This is a limitation (if you could say that) on terminals, but ideally should not be on the web where we have much more control.
This is especially noticeable when we have tab-size set to 4 with this extension, now we have the first tab character of each line being rendered to only 2 physical spaces.
We kinda solved this with remove-diff-signs, where we added the ability to remove markers completely from the DOM flow, restoring the tab translation to 4 as intended. But after #2970, this issue got introduced again, with the diff markers interfering with the tab characters at the start of the line.
Reproduction
- If having extension disabled
- Navigate to https://github.com/sindresorhus/refined-github/pull/3051/files (or any GitHub page containing diffs)
- The first tab space should 8 characters wide, but it is only 6 characters wide.
- If having extension enabled, the first tab space should 4 characters wide, but
- On https://github.com/sindresorhus/refined-github/pull/2925/files#diff-cc4aac3e9be04e0413c9520f223b493c, it is 3 characters wide (for Markdown files).

- On https://github.com/sindresorhus/refined-github/pull/2925/files#diff-772cd0654b9fa71c547378faaf48fcb0, it is 2 characters wide (for any other file).

- On https://github.com/sindresorhus/refined-github/pull/2925/files#diff-cc4aac3e9be04e0413c9520f223b493c, it is 3 characters wide (for Markdown files).
How should this be solved?
remove-diff-signs should remove diff markers from the DOM flow completely, as it used to do before, letting tabs flow as if they are the first character on the line.
How would we solve #2970 then? Remove negative text indentation mentioned above.
Activity
fregante commentedon May 3, 2020
I'll simplify: In diffs, the first tab on each line appears to be 2 characters instead of 4.
Live example and screenshot:
This happens because in diffs there are 2 extra characters at the beginning of each line. The first tab includes these, but shouldn't.
This is unrelated to existing features, but it's a pre-existing GitHub bug that Refined GitHub highlights and could fix.
fregante commentedon May 3, 2020
This is dangerous and not advised. We used to do that before it became possible via CSS and it caused a lot of headaches.
I might have found a CSS solution, but needs testing
fregante commentedon May 6, 2020
It doesn't work well in unified view. It needs further work and testing.
CSS-only PR welcome starting with the code from #3058