I exit the code::block and delete the configuration file named 'default.conf'. Then restart it, it can do auto indent now. I think maybe there is something wrong in my old configuration file, and that makes code::block can't get correct value.
Thank you.