|
|
|
@ -45,40 +45,37 @@ namespace ICSharpCode.SharpDevelop.Editor
@@ -45,40 +45,37 @@ namespace ICSharpCode.SharpDevelop.Editor
|
|
|
|
|
{ |
|
|
|
|
readonly ReadOnlyDocument doc; |
|
|
|
|
readonly int lineNumber; |
|
|
|
|
readonly int offset, endOffset; |
|
|
|
|
|
|
|
|
|
public ReadOnlyDocumentLine(ReadOnlyDocument doc, int lineNumber) |
|
|
|
|
{ |
|
|
|
|
this.doc = doc; |
|
|
|
|
this.lineNumber = lineNumber; |
|
|
|
|
this.offset = doc.GetStartOffset(lineNumber); |
|
|
|
|
this.endOffset = doc.GetEndOffset(lineNumber); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int Offset { |
|
|
|
|
get { |
|
|
|
|
return doc.GetStartOffset(lineNumber); |
|
|
|
|
} |
|
|
|
|
get { return offset; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int Length { |
|
|
|
|
get { |
|
|
|
|
return doc.GetEndOffset(lineNumber) - doc.GetStartOffset(lineNumber); |
|
|
|
|
} |
|
|
|
|
get { return endOffset - offset; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int EndOffset { |
|
|
|
|
get { |
|
|
|
|
return doc.GetEndOffset(lineNumber); |
|
|
|
|
} |
|
|
|
|
get { return endOffset; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int TotalLength { |
|
|
|
|
get { |
|
|
|
|
return doc.GetTotalEndOffset(lineNumber) - doc.GetStartOffset(lineNumber); |
|
|
|
|
return doc.GetTotalEndOffset(lineNumber) - offset; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int DelimiterLength { |
|
|
|
|
get { |
|
|
|
|
return doc.GetTotalEndOffset(lineNumber) - doc.GetEndOffset(lineNumber); |
|
|
|
|
return doc.GetTotalEndOffset(lineNumber) - endOffset; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -248,7 +245,7 @@ namespace ICSharpCode.SharpDevelop.Editor
@@ -248,7 +245,7 @@ namespace ICSharpCode.SharpDevelop.Editor
|
|
|
|
|
|
|
|
|
|
public ITextBuffer CreateSnapshot() |
|
|
|
|
{ |
|
|
|
|
return this; // ReadOnlyDocument is immutable
|
|
|
|
|
return textBuffer; // textBuffer is immutable
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ITextBuffer CreateSnapshot(int offset, int length) |
|
|
|
|