When I am typing code, it is not indenting the closing braces, or the new line for content, on statements such as 'if' or else': it puts them at the start of the line.
But if I format the document with ctrl-shift-f, it fixes the indentation.
Here is typed code:
Code: Select all
static void test_function(void)
{
if (true) {
//this is not indented!
}else {
//this is not indented!
}
if(true){
//I manually indented this and the brace below
} else {
//This is still not indented!
}
}
Code: Select all
static void test_function(void) {
if (true) {
// this is not indented!
} else {
// this is not indented!
}
if (true) {
// I manually indented this and the brace below
} else {
// This is still not indented!
}
}
Code: Select all
# We'll use defaults from the LLVM style, but with some modifications so that it's close to the CDT K&R style.
BasedOnStyle: LLVM
UseTab: Always
IndentWidth: 4
TabWidth: 4
PackConstructorInitializers: NextLineOnly
BreakConstructorInitializers: AfterColon
IndentAccessModifiers: false
AccessModifierOffset: -4
Thank you