fix formatting crash bug in code editor widget