[TextEditor] Speed up folding in large files.