vscode-clang-format
vscode-clang-format copied to clipboard
Different styles for each save
Everytime I save a cpp file, some certain small parts of the file would repeatedly be changed space. like the
public:
public:
would add this space in one run and remove in another run. So I get unclear commits. What could be the reason?
if (count > LEVELS - 1) break;
if (count > LEVELS - 1)
break;
Another example it would move the break to one line or 2 lines back and forth.
I have a similar problem using c.
When using BasedOnStyle: Google
It keeps switching between:
#include "test.h"
#include <string.h>
void main() {}
and
#include "test.h"
#include <string.h>
void main() {}
This holds for many files, although I have noticed this only occurs when I have more than 1 grouping of headers. It even occurs with changes to the style:
BasedOnStyle: Google
IndentWidth: 4
UseTab: Always
TabWidth: 4
AllowShortIfStatementsOnASingleLine: Always
ColumnLimit: 140
AccessModifierOffset: -4
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerAlignment: false
IncludeCategories:
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 1
---
Language: Cpp
AllowShortFunctionsOnASingleLine: All
EDIT: Interestingly, it also does not happen when a macro definition is inserted in between a group of 2.