Optional hook so subclasses can react to text edits before spans shift.
void onBeforeTextChange(String oldText, String newText) {}