switch, adding new case formatting is tabbed
When I add the second case I don't type backspace to set the tab to the correct tab I thought that clion would automatically tab it so I left it like that and came here to tell you that clion isn't automatically indenting switch case to align all cases automatically. I'm using the commodore theme otherwise everything else is default:
#include <iostream>
using namespace std;
enum PlayerStatus {
PS_Running,
PS_Walking,
PS_Crouching
};
const float RunSpeed = 800.f;
const float WalkSpeed = 500.f;
const float CrouchSpeed = 350.f;
void UpdateMovementSpeed(PlayerStatus P_Status, float& speed);
int main() {
float MovementSpeed;
PlayerStatus status = PS_Crouching;
UpdateMovementSpeed(status, MovementSpeed);
cout << "Movement speed: " << MovementSpeed << endl;
system("pause");
}
void UpdateMovementSpeed(PlayerStatus P_Status, float& speed) {
switch (P_Status) {
case PS_Running:
speed = RunSpeed;
break;
case PS_Walking:
speed = WalkSpeed;
break;
case PS_Crouching:
speed = CrouchSpeed;
}
}
请先登录再写评论。
Hello!
So far, I can't reproduce the issue in a default "Hello, World!" project (File | New Project > C++ Executable > Create). As soon as I type
:
after the secondcase
, the line gets indented correctly.Does the issue happen for you in the default "Hello, World!" project (File | New Project > C++ Executable > Create)?
I made a second project and copied the code to include the main and above code and then typed out the bottom function and it does not indent switch case for me so I took a video of if and will show you now on youtube:
https://youtu.be/2TXPP1S7qj4