|
|
@ -65,7 +65,7 @@ namespace ICSharpCode.ILSpy.TextView |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public sealed class AvalonEditTextOutput : ISmartTextOutput |
|
|
|
public sealed class AvalonEditTextOutput : ISmartTextOutput |
|
|
|
{ |
|
|
|
{ |
|
|
|
int lineNumber = 1; |
|
|
|
TextOutputLocation location = new TextOutputLocation { Line = 1, Column = 1 }; |
|
|
|
int lastLineStart = 0; |
|
|
|
int lastLineStart = 0; |
|
|
|
readonly StringBuilder b = new StringBuilder(); |
|
|
|
readonly StringBuilder b = new StringBuilder(); |
|
|
|
|
|
|
|
|
|
|
@ -117,6 +117,13 @@ namespace ICSharpCode.ILSpy.TextView |
|
|
|
get { return b.Length; } |
|
|
|
get { return b.Length; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TextOutputLocation Location { |
|
|
|
|
|
|
|
get { |
|
|
|
|
|
|
|
location.Column = b.Length - lastLineStart + 1; |
|
|
|
|
|
|
|
return location; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#region Text Document
|
|
|
|
#region Text Document
|
|
|
|
TextDocument textDocument; |
|
|
|
TextDocument textDocument; |
|
|
|
|
|
|
|
|
|
|
@ -188,7 +195,7 @@ namespace ICSharpCode.ILSpy.TextView |
|
|
|
b.AppendLine(); |
|
|
|
b.AppendLine(); |
|
|
|
needsIndent = true; |
|
|
|
needsIndent = true; |
|
|
|
lastLineStart = b.Length; |
|
|
|
lastLineStart = b.Length; |
|
|
|
lineNumber++; |
|
|
|
location.Line++; |
|
|
|
if (this.TextLength > LengthLimit) { |
|
|
|
if (this.TextLength > LengthLimit) { |
|
|
|
throw new OutputLengthExceededException(); |
|
|
|
throw new OutputLengthExceededException(); |
|
|
|
} |
|
|
|
} |
|
|
@ -236,17 +243,5 @@ namespace ICSharpCode.ILSpy.TextView |
|
|
|
this.UIElements.Add(new KeyValuePair<int, Lazy<UIElement>>(this.TextLength, new Lazy<UIElement>(element))); |
|
|
|
this.UIElements.Add(new KeyValuePair<int, Lazy<UIElement>>(this.TextLength, new Lazy<UIElement>(element))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int CurrentLine { |
|
|
|
|
|
|
|
get { |
|
|
|
|
|
|
|
return lineNumber; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int CurrentColumn { |
|
|
|
|
|
|
|
get { |
|
|
|
|
|
|
|
return b.Length - lastLineStart + 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|