How to change tab size in GitHub desktop app?
Asked Answered
D

3

6

I'm working on a project that uses tabs incorrectly, and therefore doesn't like that the GitHub desktop app shows them as being 4 spaces wide in the diff.

This is not nice as it's hard to read the diff inside the app because the code shows up as not being properly indented.

Is there a setting that allows to customize the tab size?

Dibs answered 15/7, 2015 at 6:37 Comment(2)
possible duplicate of How to change tab size on GitHub?Xavier
oh, I stopped reading at GitHub, my bad!Xavier
K
1

This feature is available since 3.4.2. You can find it here:

File -> Options -> Appearance -> Tab size

Have a look at the release notes:

3.4.2

Released: 6/25/2024

    [New] Option to use Git Credential Manager for repositories hosted outside of GitHub.com - #18700
    [New] Allow customizing tab character width in spaces - #15561
    [Fixed] Remote urls containing spaces are now displayed in their entirety in the remote settings screen - #18876
    [Fixed] Newly uploaded images are rendered in Pull Request comments and reviews - #18830
Klenk answered 12/9 at 13:23 Comment(0)
A
3

One can edit the installed stylesheet for GitHub Desktop.

Add the following to GitHub\ Desktop.app/Contents/Resources/app/renderer.css on Mac:

* { tab-size: 4; }

This likely will be reset after an update, but I'll cross that bridge when it comes.

Adz answered 8/11, 2023 at 16:41 Comment(2)
This is quite hacky but it works - also under Windows. Under Windows I found renderer.css under %LOCALAPPDATA%\GitHubDesktop\app-3.3.6\resources\app so it's version specific.Mouldon
it's /var/lib/flatpak/app/io.github.shiftey.Desktop/current/active/files/github-desktop/resources/app/renderer.css in Linux.Kasandrakasevich
O
2

2021: There is at least a setting on github.com.

2015: I just checked with the latest version of GitHub for Windows (2.14.7), and this option doesn't seem to be available.

G4W

Oviduct answered 15/7, 2015 at 7:0 Comment(2)
Still not seeing this option today on github-for-Mac v 3.1.2... :,(Eavesdrop
@Eavesdrop True, this is still not directly visible in the GitHub Desktop application.Oviduct
K
1

This feature is available since 3.4.2. You can find it here:

File -> Options -> Appearance -> Tab size

Have a look at the release notes:

3.4.2

Released: 6/25/2024

    [New] Option to use Git Credential Manager for repositories hosted outside of GitHub.com - #18700
    [New] Allow customizing tab character width in spaces - #15561
    [Fixed] Remote urls containing spaces are now displayed in their entirety in the remote settings screen - #18876
    [Fixed] Newly uploaded images are rendered in Pull Request comments and reviews - #18830
Klenk answered 12/9 at 13:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.