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

alignConsecutiveListElements style is not supported for consecutive one line list declarations. #2

Open
sh4nnu opened this issue Aug 23, 2019 · 0 comments

Comments

@sh4nnu
Copy link
Owner

commented Aug 23, 2019

Description:
This style option aligns the elements of list declarations if they are in a nested list declaration.

**Features to be implemented: **
The style should also support consecutive one-line declarations.

Input:


int a =  { "all", f_all, 0 };
int b =  { "cbr", f_cbreak,	"F_OFFOK" };
int v =  { "col", f_columns, "F_NEEDARG" };
int c =  { "col", f_columns, "F_NEEDARG" };
int x =  { "coo",  f_sane, 0 };

Expected Output:

int a =  { "all",         f_all,                0 };
int b =  { "cbr",       f_cbreak,	       "F_OFFOK" };
int v =  { "col",       f_columns,      "F_NEEDARG" };
int c =  { "col",       f_columns,      "F_NEEDARG" };
int x =  { "coo",      f_sane,            0 };

Bug:
The alignment of elements on column more than 2 get aligned with unexpected spaces, for different lengths of elements in column 1.

Input:

keys[] = {
	{"all",    fall, 0 },
	{ "cbreak",  f_cbreak,    1 },
	{"column",  f_columns,   3 },
	{ "col",     f_columns, 4 },
	{"cooked",  flast, 0 }

};

Output:

keys[] = {  { "all",         fall,        0 },
            { "cbreak",      f_cbreak,        1 },
            { "column",      f_columns,       3 },
            { "col",         f_columns,       4 },
            { "cooked",      flast,       0 }

};

Expected Output:

keys[] = { { "all",             fall,		        0 },
           { "cbreak",          f_cbreak,	    	1 },
           { "column",          f_columns,	        2 },
           { "col",             f_columns,	        3 },
           { "cooked",          flast,		        4 }
};
sh4nnu added a commit that referenced this issue Aug 23, 2019
[clang-format] New Style option AlignConsecutiveListElements
This style option aligns all the elements of consecutive list declarations
according the column in which they are present.

Example:

keys[] = {
	{ "all",	fall,		0 },
	{ "cbreak",	f_cbreak,	"F_OFFOK" },
	{ "cols",	f_columns,	"F_NEEDARG" },
	{ "columns",	f_columns,	"F_NEEDARG" },
	{ "cooked", 	flast,		0 }

}

Bug: #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.