Standardise on TABS, not SPACES, for indenting

Issue #755 resolved
Brian Lewis repo owner created an issue

There is a mixture of TAB and SPACE indenting throughout the code base.

This has probably arisen from different versions of editors (different VS versions?) and different settings in VS over time.

Most critical setting is in VS Tools → Options, to preserve TABS rather than replace them with spaces:

This needs to be set for each file type.

Then, it can be a matter of personal preference what size the TAB is rendered, but I would suggest:

C#, 4

everything else: 2

In SourceTree, the built-in diff viewer always expands tabs as 4 spaces. It works best for seeing what “real” differences are between versions to use the option Ignore Whitespace:

Although the change in white space will not be displayed, it will still be regarded by git as a change to the file.

Comments (2)

  1. Brian Lewis reporter

    Note these options in Visual Studio under Edit->Advanced:

    Tabify Selected Lines - converts leading spaces to tabs. Respects the tab size setting in tools->options when making this conversion.

    View White Space - toggle display spaces and tabs (CTRL-E,S)

  2. Log in to comment