Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 7

What's the deal with tab sizes on GitHub Gists?

Solved! Go to Solution.

I just created my first gist and set the Tab size to 4 but once I saved it, it got rendered with 8 spaces for some reason.

Horrified about the look, I hit "edit", saw that it was set to 8, set it back to 4, saved it and again - 8...

 

If GitHub simply doesn't support different Tab indentations (which I realize has been requested for years: https://github.com/isaacs/github/issues/170 ), then at least that drop down box for size should be greyed out when "Tabs" is selected...

 

But of course I'm hoping that this is all just some... misunderstanding and that there is in fact a way to make proper tab rendering work because... it's kind of a trivial thing.

6 Replies
Solution
Community Manager
Message 2 of 7

Re: What's the deal with tab sizes on GitHub Gists?

Hi @s-h-a-d-o-w,

 

The Gist tab size settings only applies to the editor and not to the rendered file. The default tab size is 8. There is no way to permanently change that, however you can modify it for a specific page load by using the ts=<size> URL parameter.

 

Thanks!

Highlighted
Copilot Lvl 3
Message 3 of 7

Re: What's the deal with tab sizes on GitHub Gists?

What a shame (and strange that that URL parameter exists but no UI display setting that does that) but thanks for the confirmation!

Copilot Lvl 3
Message 4 of 7

Re: What's the deal with tab sizes on GitHub Gists?

Actually, in the case someone else stumbles across this - I got aware that there are workarounds in the form of extensions for Chrome available (e.g. GitHub Custom Tab Size) and this inspired me to develop my own one that integrates directly into GitHub:

https://github.com/s-h-a-d-o-w/github-userscripts

Copilot Lvl 3
Message 5 of 7

Re: What's the deal with tab sizes on GitHub Gists?

"There is no way to permanently change that"

 

Wrong - there is no way for us users to permanently change it, but Github obviously has the ability to change it from their end, which is something that shouldn't be dismissed. 8 is far too big and ugly for the default size.

Ground Controller Lvl 1
Message 6 of 7

Re: What's the deal with tab sizes on GitHub Gists?

Why on earth would a code repository default to 8 spaces to begin with, in a world where no one uses 8 spaces, is beyond me. Not blaming you or anyone in particular. I'm just saying. It just makes no sense.

 

It's a matter of preference, and I'm fine with anyone prefering 8 spaces, but then it also makes no sense that such a basic option to suit the user's preference isn't available to the user. Especially after all these years.

 

Currently the only workaround is to go through the trouble of switching indentation to spaces in your editor/IDE of choice before comitting stuff to Github... 

Copilot Lvl 2
Message 7 of 7

Re: What's the deal with tab sizes on GitHub Gists?

Obviously someone high up at github really really hates tabs, and is trying to make it as ugly and annoying as possible for those who prefer them.

Seriously that is the only possible reason I can come up with as to why this absolutely insane tab size is not only offered, but default, and impossible to permanently override from the UI.

 

What the hell github?