void () { if (myOldFragmentLineSet != null) { return; } CharSequence newText = getDocument().getImmutableCharSequence(); CharSequence oldFragment = getOldFragment(); myOldFragmentLineSetStart = getOffset(); if (myOldFragmentLineSetStart > 0 && newText.charAt(myOldFragmentLineSetStart - 1) == '\r') { myOldFragmentLineSetStart--; oldFragment = new MergingCharSequence("\r", oldFragment); } int newChangeEnd = getOffset() + getNewLength(); if (newChangeEnd < newText.length() && newText.charAt(newChangeEnd) == '\n') { oldFragment = new MergingCharSequence(oldFragment, "\n"); } myOldFragmentLineSet = LineSet.createLineSet(oldFragment); }