I'm trying to add an .editorconfig to our github repo to make the github code viewer display tabs as 4 spaces. This sounded pretty simple and GitHUb supposedly offers native support for it, however I can't get it to work.
I've added the following .editorconfig to the root of our repo:
# top-most EditorConfig file
root = true
# 4 space indentation
[*.{cpp,h,cs,xaml,editorconfig}]
indent_style = space
indent_size = 4
# # #
# # #
Those last 2 lines with hashes are done with tabs and spaces respectively. When I open this file in the github code viewer, the first line shows with tabs as 8 spaces. If I add ?ts=4 to the URL the tabs do display as 4 spaces.
Am I just using this wrong/expecting it to do something it doesn't? Our issue is older code in the repo was added with tabs, and we wanted to start using tabs as spaces (4 spaces) in new code, so we wanted the existing tabs to display aligned with the new ones.
Any guidance would be appreciated.
indent_style = tab
is necessary for this to work, but your file hasindent_style = space
. See if changing that setting helps.