Open
Description
Aligning an array of structures with UseTab: AlignWithSpaces
does not format correctly.
Of note, switching to UseTab: Never
does resolve the issue.
#define LONG_NAME 1
#define LONGER_NAME 2
#define THIS_IS_A_VERY_LONG_NAME 3
int i = 1 << 0;
int j = 1 << 1;
struct Foo
{
int a;
int b;
int c;
};
std::vector<Foo> foos = {
{LONG_NAME, 0, i | j},
{LONG_NAME, 0, i | j},
{LONGER_NAME, 0, i | j},
{LONGER_NAME, 0, i },
{THIS_IS_A_VERY_LONG_NAME, 0, j },
{LONGER_NAME, THIS_IS_A_VERY_LONG_NAME, i },
{LONG_NAME, THIS_IS_A_VERY_LONG_NAME, j }
};
Relevant .clang-format options:
---
Language: Cpp
BasedOnStyle: Google
AlignArrayOfStructures: Left
UseTab: AlignWithSpaces
IndentWidth: 4
TabWidth: 4