The last offset the cursor may take in text (before the suffix).
text
int maxCursor(String text) => suffix.isNotEmpty && text.endsWith(suffix) ? text.length - suffix.length : text.length;