I am on Mac and trying to do a clang-format during the save-action like below.
I also set the quick-key of clang-format like:
But when I type - command + S in Mac, I got the file saved, but the reformat is totally wrong:
class AUtilityTest : public ::testing::Test {
public:
void SetUp() override {
}
void TearDown() override {
}
protected:
};
TEST_F(UtilityTest, Test1
) {
a = 0.2;
b = 0.3;
for (
int i = 0;
i < 10;i ++) {
std::cout << a + b <<
std::endl;
}
}
I need to manually go to Code -> Reformat Code with clang-format to make it go back to normal.
How do I make it to save with clang-format at the same time? Thanks!