private void UpdateNewLines(ITextSnapshot snapshot, FrugalList <Span> lineSpans, int delta)
 {
     if (lineSpans != null)
     {
         var collection = (lineSpans.Count == 1) ? ((IReadOnlyList <Span>)lineSpans) : new NormalizedSpanCollection(lineSpans);
         for (int i = 0; (i < collection.Count); ++i)
         {
             Span lineSpan = collection[i];
             for (int line = lineSpan.Start; (line < lineSpan.End); ++line)
             {
                 ITextSnapshotLine snapshotLine = snapshot.GetLineFromLineNumber(line);
                 var state = snapshotLine.GetLineEnding();
                 if (state.HasValue)
                 {
                     this.NewlineState.Increment(state.Value, delta);
                 }
             }
         }
     }
 }