private void UpdateWhitespace(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.GetLeadingCharacter(); this.LeadingWhitespaceState.Increment(state, delta); } } } }