Skip to content

Add fix-first-tab-length feature - #3058

Closed
fregante wants to merge 2 commits into
masterfrom
first-tab-apparent-length
Closed

fregante wants to merge 2 commits into
masterfrom
first-tab-apparent-length

Conversation

@fregante

@fregante fregante commented May 3, 2020 •

Copy link
Copy Markdown
Member

Fixes #3055

Note: this works regardless of remove-diff-signs’ status.

Test

Needs further testing, but this is the starting point:

a741080#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R161

Before (short first tab) and after (all tabs are 4-characters long)
demo2

@fregante fregante closed this May 6, 2020
@fregante
fregante deleted the first-tab-apparent-length branch May 6, 2020 22:25
@notlmn

notlmn commented May 29, 2020

Copy link
Copy Markdown
Contributor

@fregante, what specifically made you drop this PR?

@fregante

Copy link
Copy Markdown
Member Author

#3055 (comment)

@notlmn

notlmn commented May 29, 2020 •

Copy link
Copy Markdown
Contributor

Yes, but I took a stab at it today, and it seems to work as expected both in unified and diff views.

/* Remove diff signs from the layout flow */
.blob-code-inner::before,
.blob-code-marker-cell::before {
	position: absolute;
	transform: translateX(-100%);
}

/* Restore the space that collapsed as a consequence of the previous rule */
:not(.js-suggested-changes-blob) tr:not(.js-expandable-line) .blob-code,
.js-suggested-changes-blob .blob-code-inner {
	padding-left: 25px !important; /* GitHub sets it to 18px */
	text-indent: 0 !important; /* GitHub sets it to -7px */
}

/* Adjust add comment button position, because of extra padding above */
.add-line-comment {
	margin-left: -37px !important; /* GitHub sets this at -28px */
}

@fregante

Copy link
Copy Markdown
Member Author

Place it in the CSS box in the options and test it out for a few days. If it works open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants