public virtual Chunk GetChunks(int offset, int length) { SyntaxModeService.ScanSpans(doc, mode, spanParser.CurRule, spanParser.SpanStack, line.Offset, offset); length = System.Math.Min(doc.Length - offset, length); str = length > 0 ? doc.GetTextAt(offset, length) : null; curChunk = new Chunk(offset, 0, GetSpanStyle()); spanParser.ParseSpans(offset, length); curChunk.Length = offset + length - curChunk.Offset; if (curChunk.Length > 0) { curChunk.Style = GetStyle(curChunk) ?? GetSpanStyle(); AddRealChunk(curChunk); } return(startChunk); }
public virtual Chunk GetChunks(int offset, int length) { if (lineOffset < offset) { SyntaxModeService.ScanSpans(doc, mode, spanParser.CurRule, spanParser.SpanStack, lineOffset, offset); } length = System.Math.Min(doc.TextLength - offset, length); var minOffset = curChunk == null ? 0 : curChunk.Offset + curChunk.Length; curChunk = new Chunk(offset, 0, GetSpanStyle()); spanParser.ParseSpans(offset, length); curChunk.SpanStack = spanParser.SpanStack; curChunk.Length = offset + length - curChunk.Offset; if (curChunk.Length > 0 && curChunk.Offset >= minOffset) { curChunk.Style = GetStyle(curChunk) ?? GetSpanStyle(); AddRealChunk(curChunk); } return(startChunk); }