Improve performance of folding by using DocumentFragment when there are a lot of lines to fold