Initialiser list incorrect indentation

I've been having problems with indentation in CLion for a bit and I don't know how to fix them. I've played with the Code Style settings but I've had no luck.

The problem is if I copy this:

CLAY({
	.layout = {
		.sizing = {
			.width = CLAY_SIZING_FIXED(2),
			.height = CLAY_SIZING_GROW(0),
		},
	},
	.backgroundColor = {255, 255, 255, 255},
});

the copy looks like

clay->element({
			.layout = {
				.sizing = {
					.width = CLAY_SIZING_FIXED(2),
					.height = CLAY_SIZING_GROW(0),
				},
			},
			.backgroundColor = {255, 255, 255, 255},
		});

So two additional tabs are added.

This can mostly be fixed by hitting backspace before a .<member> so pressing backspace before .layout removes the two extra tabs. Pressing shift-tab does not fix this issue as when this code is pasted into CLion                is added (14 spaces instead of two tabs) so basically an additional tab and 2 spaces are added on top of the 2 tabs already added when initially copying. Unfortunately this doesn't work for braces as pressing backspace only removes one tab (so it is in line with the previous .<member>).

Like so:

clay->element({
	.layout = {
		.sizing = {
			.width = CLAY_SIZING_FIXED(2),
			.height = CLAY_SIZING_GROW(0),
			},
			},
			.backgroundColor = {255, 255, 255, 255},
			});

How can I fix each of these problems?

a) Incorrect copy

b) Pasting the code adding even more spacing

c) Pressing back on a brace being in-line with the previous member

0

Please sign in to leave a comment.