Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow the user’s tab-size setting where possible #4833

Merged
merged 6 commits into from
Oct 1, 2021
Merged

Conversation

fregante
Copy link
Member

@fregante fregante commented Sep 30, 2021

What

  • In files, follow the user’s setting
  • In comments, stick to 4 characters because GitHub is ignoring the setting
  • Preserves support in show-whitespace

Test

Working natively

GitHub bugs…

GitHub ignores the user setting in comments and just sets data-tab-size="8" in the DOM 🤷‍♂️ so I will force it in this case.

Screenshot 1

Screen Shot 2

Screenshot 2

Screen Shot 3

@fregante fregante added the bug label Sep 30, 2021
@kidonng
Copy link
Member

kidonng commented Sep 30, 2021

Also fixes #4806

Comment on lines +5 to +7
[data-tab-size] {
--tab-size: attr(data-tab-size);
}
Copy link
Member Author

@fregante fregante Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Demo suggestion, do not resolve

Suggested change
[data-tab-size] {
--tab-size: attr(data-tab-size);
}
[data-tab-size] {
--tab-size: attr(data-tab-size);
}

@fregante fregante changed the title Drop hard-coded tab size Reduce scope of hard-coded tab size Oct 1, 2021
@fregante fregante marked this pull request as draft October 1, 2021 06:56
@fregante fregante marked this pull request as ready for review October 1, 2021 07:07
@fregante
Copy link
Member Author

fregante commented Oct 1, 2021

Last chance for review. Will merge within 8 hours

@fregante fregante changed the title Reduce scope of hard-coded tab size Follow the user’s tab-size setting where possible Oct 1, 2021
@fregante fregante mentioned this pull request Oct 1, 2021
1 task
@@ -1,3 +1,32 @@
/*
Can't use this because attributes are strings and calc() won't cast them
ttps://stackoverflow.com/a/40815884
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file get a GHE comment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GHE is mentioned in a different comment. This code is not related to GHE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this link missing a leading h?

@fregante
Copy link
Member Author

fregante commented Oct 1, 2021

argh I forgot to merge this… I'll release v21.8.2 I guess 😂

@fregante fregante merged commit 0313dc8 into main Oct 1, 2021
@fregante fregante deleted the drop-tab-size branch October 1, 2021 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

It overrides GitHub built-in "Tab size preference" GitHub's custom tab size is overridden
4 participants