What's the deal with tab sizes on GitHub Gists? #23860
-
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: isaacs/github#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. |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 4 replies
-
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 Thanks! |
Beta Was this translation helpful? Give feedback.
-
What a shame (and strange that that URL parameter exists but no UI display setting that does that) but thanks for the confirmation! |
Beta Was this translation helpful? Give feedback.
-
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: |
Beta Was this translation helpful? Give feedback.
-
“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. |
Beta Was this translation helpful? Give feedback.
-
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… |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
True. It must be a tab hater. They purposly set the tab width to 8 just to annoy us tabbies. Do they really not see that you can setup tabs to use as much space as 4 spaces? |
Beta Was this translation helpful? Give feedback.
-
I found a workaround/solution: Cheers. |
Beta Was this translation helpful? Give feedback.
-
Been waiting for this to be fixed since Adam was a boy and still not fixed… You can change to 4 in setting but it defaults back to 8… |
Beta Was this translation helpful? Give feedback.
-
You should be able to specify the rendered tabs and spaces. An intern should be able to code this, maybe that’s a stretch, but why is it impossible to set the tab spacing at a reasonable, or any specified length for rendering after the fact? Auto converting to tab => 8 fails at WUSIWUG. I cant paste code with space: 2 for tabs and it screw up the rendering with the converted to tab: 8, what, really? Come on MS. Or does gisthub have a github for a pull request for this what should already be baked in feature request? |
Beta Was this translation helpful? Give feedback.
-
Looking at the case more closely we need to open a new issue this one is dead. It is not-so clearly, but suspected this issue is ‘closed’ and future updates > /dev/null as this has been ‘SOLVED BY THAT-PAT IN POST #2’ Hence no new attention despite the additional responses, at least I hope this to be true… Re-escalate the issue Why can tab spacing not be set in gists? And to be sure this is not a solution: pre { tab-size: 4 } · Issue #170 · isaacs/github · GitHub There should be a UI option and per-file not what, globally? |
Beta Was this translation helpful? Give feedback.
-
This seems to be a user setting now: Tab size rendering preference | GitHub Changelog |
Beta Was this translation helpful? Give feedback.
-
Not sure if this is the right issue, but GitHub's current solution for changing the tab width on code only works for the values 1 to 12 anyway. If you want something wider, like 16 or 24 (which is useful for column based files like assembly listings, tab separated CSV, etc) it simply won't work. I've traced the issue to the https://github.githubassets.com/assets/github-762fdeac7c4d.css The relevant CSS is:
As you can see they only define a mapping from the |
Beta Was this translation helpful? Give feedback.
-
I came here because I'm still having this issue after setting my tab size preference to 2. The tab size on the editor overwrote my settings and switched back to tab size 8. This is driving me crazy. |
Beta Was this translation helpful? Give feedback.
This seems to be a user setting now: Tab size rendering preference | GitHub Changelog