Oops, sorry about that. I guess I did not read the docs closely enough.
Reading through your patch, it seems like it relies too much on a specific order of events (which *might* be interrupted/altered someday in the future). I think a cleaner way is to:
[...] add an API call into sdk/ccmanager.cpp line 742, so SmartIndent plugins get called at when necessary.
Have CCManager either broadcast a
CC_Done event (which SmartIndent plugins could pick up), or iterate through all SmartIndent plugins and execute
plugin->OnCCDone(ed).