I'm learning the AI C++ SDK and trying to create a plugin. The plugin mainly funciton is :
1. open document using "SnpDocumentHelper::OpenDocument"
2. make some changes with find and replace like "SnpText::FindAndReplace"
3. Save document with "SnpDocumentHelper::SaveDocument"
4. close documetn with "SnpDocumentHelper::CloseDocument"
5. repeat 1-5
Currect situation is that if we only do step 1 and step 2, everything is expected, those documents were opened and find replace worked as well, then if I close those opened documents, it will ask for save.
The problem is that, if we add step3 and step4, the document change won't be saved. Even just added step3 without step4, the changes are also disappeared.
We have no idea why it hebavies like this. Mabe the change status was notified later than saving document in code?
So, the question is how to save a changed document using C++ API properly?