Properly invalidate cursor for large texts
Properly invalidate cursor for large texts

All cases where the cursor returns None should invalidate, meaning
that a subsequent call to `get_leaf()` will also return None.

google/xi-editor,google/xi-editor,google/xi-editor,google/xi-editor