Implement indent and dedent with a stack so it works properly