mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user