I'd like to improve the SmartIndentHDL plugin.
The following case:
process begin
...
end pro|
After typing "pro" CC pops up and I choose "process".
Normally the SmartIndent plugin chatches the wxEVT_SCI_CHARADDED event.
I tried additional with wxEVT_SCI_AUTOCOMP_SELECTION but at this time the completion is not done yet so the
line only contains "end pro" and the plugin can't decide how to unindent.
Any ideas?
Hooking into the modified event should notify you at the right time (but it will also give many other notifications, so watch out for double handling events).
if (evtType == wxEVT_SCI_MODIFIED && (event.GetModificationType() & wxSCI_MOD_INSERTTEXT))
{
// handle changes...
if (!didJustAutocomplete()) // might need to try a filter or something (wxSCI_PERFORMED_USER might help)
return; // ignore
}
Alternatively, you could add an API call into sdk/ccmanager.cpp line 742, so SmartIndent plugins get called at when necessary.