1

I have some weird issue: It's not very important, but I want my code to look nice on GitHub.

I've implemented MergeSort in AEC, and I posted it to GitHub, you can see it here.
However, the indentation doesn't look the same as it does in Notepad++ or VS Code, here is how the lines 101-107 look if I open that file in Notepad++:

How it looks in Notepad++

I don't expect syntax highlighting to work on GitHub, the syntax highlighting for AEC works in Notepad++ because I opened the Notepad++ script to highlight AEC code.
However, I would expect the indentation to look the same whether it's on GitHub or in a text editor.
So, why it doesn't?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
FlatAssembler
  • 667
  • 7
  • 30
  • 1
    I guess tab width are not the same. – Toto Dec 31 '19 at 15:43
  • 1
    In Notepad++, check Settings > Preferences > Language > Tab Settings. In VS Code, check Settings > "editor indentation". You probably have mismatched indentation settings. – Gino Mempin Dec 31 '19 at 15:53

1 Answers1

1

It does look the same with this URL: MergeSort/msort.aec?ts=4

The tab width on GitHub is 8 by default, but you can change it through a parameter.

There is no global preference though. You would need a Userscript to make it (locally) persistent.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Can I somehow force an editor to convert every tab to a certain number of spaces? – FlatAssembler Dec 31 '19 at 16:35
  • 1
    @FlatAssembler It depends on the editor. Here is an example for Notepad++: https://stackoverflow.com/a/7471232/6309. For VSCode: https://stackoverflow.com/a/29972553/6309 – VonC Dec 31 '19 at 16:36
  • @FlatAssembler I have edited my previous comment to include VSCode. – VonC Dec 31 '19 at 16:39