fixed StackOverflowError when pasting text lines larger than maxLines