Extract TextViewAutocomplete to separate file

Move TextViewAutocomplete class from TextView.cs to TextViewAutocomplete.cs

Build and all 163 tests pass
This commit is contained in:
Tig
2025-11-21 15:59:40 -07:00
parent 5a8f2699ba
commit 26b3fc916d
2 changed files with 22 additions and 21 deletions

View File

@@ -4884,24 +4884,4 @@ public class TextView : View, IDesignable
base.Dispose (disposing);
}
}
/// <summary>
/// Renders an overlay on another view at a given point that allows selecting from a range of 'autocomplete'
/// options. An implementation on a TextView.
/// </summary>
public class TextViewAutocomplete : PopupAutocomplete
{
/// <inheritdoc/>
protected override void DeleteTextBackwards () { ((TextView)HostControl!).DeleteCharLeft (); }
/// <inheritdoc/>
protected override void InsertText (string accepted) { ((TextView)HostControl!).InsertText (accepted); }
/// <inheritdoc/>
protected override void SetCursorPosition (int column)
{
((TextView)HostControl!).CursorPosition =
new (column, ((TextView)HostControl).CurrentRow);
}
}
}

View File

@@ -0,0 +1,21 @@
namespace Terminal.Gui.Views;
/// <summary>
/// Renders an overlay on another view at a given point that allows selecting from a range of 'autocomplete'
/// options. An implementation on a TextView.
/// </summary>
public class TextViewAutocomplete : PopupAutocomplete
{
/// <inheritdoc/>
protected override void DeleteTextBackwards () { ((TextView)HostControl!).DeleteCharLeft (); }
/// <inheritdoc/>
protected override void InsertText (string accepted) { ((TextView)HostControl!).InsertText (accepted); }
/// <inheritdoc/>
protected override void SetCursorPosition (int column)
{
((TextView)HostControl!).CursorPosition =
new (column, ((TextView)HostControl).CurrentRow);
}
}