Skip to content

Commit aebef6d

Browse files
committed
feature netcore3 support #168
icsharpcode/AvalonEdit#168 (partial) TextDocument changes will be updated separately.
1 parent b22c3b8 commit aebef6d

File tree

3 files changed

+4
-89
lines changed

3 files changed

+4
-89
lines changed

src/AvaloniaEdit/Editing/DottedLineMargin.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ public static IControl Create()
5353
return line;
5454
}
5555

56-
/// <summary>
57-
/// Creates a vertical dotted line to separate the line numbers from the text view.
58-
/// </summary>
59-
internal static IControl Create(IControl editor)
60-
{
61-
var line = (Line)Create();
62-
line.Bind(Shape.StrokeProperty, new Binding("LineNumbersForeground") { Source = editor });
63-
return line;
64-
}
65-
6656
/// <summary>
6757
/// Gets whether the specified UIElement is the result of a DottedLineMargin.Create call.
6858
/// </summary>

src/AvaloniaEdit/Folding/FoldingSection.cs

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -124,73 +124,6 @@ public string Title
124124
/// </summary>
125125
public string TextContent => _manager.Document.GetText(StartOffset, EndOffset - StartOffset);
126126

127-
/// <summary>
128-
/// Gets the content of the collapsed lines as tooltip text.
129-
/// </summary>
130-
public string TooltipText
131-
{
132-
get
133-
{
134-
// This fixes SD-1394:
135-
// Each line is checked for leading indentation whitespaces. If
136-
// a line has the same or more indentation than the first line,
137-
// it is reduced. If a line is less indented than the first line
138-
// the indentation is removed completely.
139-
//
140-
// See the following example:
141-
// line 1
142-
// line 2
143-
// line 3
144-
// line 4
145-
//
146-
// is reduced to:
147-
// line 1
148-
// line 2
149-
// line 3
150-
// line 4
151-
152-
var startLine = _manager.Document.GetLineByOffset(StartOffset);
153-
var endLine = _manager.Document.GetLineByOffset(EndOffset);
154-
var builder = new StringBuilder();
155-
156-
var current = startLine;
157-
ISegment startIndent = TextUtilities.GetLeadingWhitespace(_manager.Document, startLine);
158-
159-
while (current != endLine.NextLine)
160-
{
161-
ISegment currentIndent = TextUtilities.GetLeadingWhitespace(_manager.Document, current);
162-
163-
if (current == startLine && current == endLine)
164-
builder.Append(_manager.Document.GetText(StartOffset, EndOffset - StartOffset));
165-
else if (current == startLine)
166-
{
167-
if (current.EndOffset - StartOffset > 0)
168-
builder.AppendLine(_manager.Document.GetText(StartOffset, current.EndOffset - StartOffset).TrimStart());
169-
}
170-
else if (current == endLine)
171-
{
172-
builder.Append(startIndent.Length <= currentIndent.Length
173-
? _manager.Document.GetText(current.Offset + startIndent.Length,
174-
EndOffset - current.Offset - startIndent.Length)
175-
: _manager.Document.GetText(current.Offset + currentIndent.Length,
176-
EndOffset - current.Offset - currentIndent.Length));
177-
}
178-
else
179-
{
180-
builder.AppendLine(startIndent.Length <= currentIndent.Length
181-
? _manager.Document.GetText(current.Offset + startIndent.Length,
182-
current.Length - startIndent.Length)
183-
: _manager.Document.GetText(current.Offset + currentIndent.Length,
184-
current.Length - currentIndent.Length));
185-
}
186-
187-
current = current.NextLine;
188-
}
189-
190-
return builder.ToString();
191-
}
192-
}
193-
194127
/// <summary>
195128
/// Gets/Sets an additional object associated with this folding section.
196129
/// </summary>

src/AvaloniaEdit/Search/SearchPanel.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
240240
/// </summary>
241241
public void Uninstall()
242242
{
243-
CloseAndRemove();
243+
Close();
244+
_textArea.DocumentChanged -= TextArea_DocumentChanged;
245+
if (_currentDocument != null)
246+
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
244247
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
245248
}
246249

@@ -490,17 +493,6 @@ public void Close()
490493
_textArea.Focus();
491494
}
492495

493-
/// <summary>
494-
/// Closes the SearchPanel and removes it.
495-
/// </summary>
496-
private void CloseAndRemove()
497-
{
498-
Close();
499-
_textArea.DocumentChanged -= TextArea_DocumentChanged;
500-
if (_currentDocument != null)
501-
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
502-
}
503-
504496
/// <summary>
505497
/// Opens the an existing search panel.
506498
/// </summary>

0 commit comments

Comments
 (0)