Skip to content

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

Merged
fregante merged 6 commits into
mainfrom
drop-tab-size
Oct 1, 2021
Merged

fregante merged 6 commits into
mainfrom
drop-tab-size

Conversation

@fregante

@fregante fregante commented Sep 30, 2021 •

Copy link
Copy Markdown
Member

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

kidonng commented Sep 30, 2021

Copy link
Copy Markdown
Member

Also fixes #4806

Comment thread source/refined-github.css Resolved
Comment on lines +5 to +7
[data-tab-size] {
--tab-size: attr(data-tab-size);
}

@fregante fregante Oct 1, 2021 •

Copy link
Copy Markdown
Member Author

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

fregante commented Oct 1, 2021

Copy link
Copy Markdown
Member Author

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 done
@@ -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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

fregante commented Oct 1, 2021

Copy link
Copy Markdown
Member Author

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
Comment thread source/refined-github.css Resolved
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