Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distinguish between indentation and alignment #17737

Closed
Trass3r opened this issue Sep 25, 2013 · 3 comments
Closed

distinguish between indentation and alignment #17737

Trass3r opened this issue Sep 25, 2013 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@Trass3r
Copy link
Contributor

Trass3r commented Sep 25, 2013

Bugzilla Link 17363
Resolution FIXED
Resolved on Sep 27, 2013 11:20
Version trunk
OS All

Extended Description

Currently tabs are poorly handled by just replacing X spaces with a tab.
Note that this even breaks the AlignTrailingComments+UseTab combination.

I use tabs for indentation and spaces for any remaining alignment.
That way everyone can use their preferred tab width setting and everything is still perfectly aligned and displayed consistently.

if (... && // bla
...) // bla

or
callFoo(param1,
param2)

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 26, 2013

Note that w agree that "replace 8 spaces with tabs" is insane, but unfortunately it's Linus Torvald's insanity, so we'll need to keep the current behavior, and implement the proposed behavior as an option.

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 27, 2013

Note that this even breaks the AlignTrailingComments+UseTab combination.

This particular issue should be fixed in r191497.

We're thinking about implementing the rest of your proposal under a separate style option, because the current behavior is also sometimes desired (e.g. it's what Linux Kernel uses).

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 27, 2013

As of r191529, clang-format understands UseTab: ForIndentation, which should do what you need. See http://clang.llvm.org/docs/ClangFormatStyleOptions.html for the description.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-format
Projects
None yet
Development

No branches or pull requests

2 participants