TextViewAutocomplete.cs 740 B

123456789101112131415161718192021
  1. namespace Terminal.Gui.Views;
  2. /// <summary>
  3. /// Renders an overlay on another view at a given point that allows selecting from a range of 'autocomplete'
  4. /// options. An implementation on a TextView.
  5. /// </summary>
  6. public class TextViewAutocomplete : PopupAutocomplete
  7. {
  8. /// <inheritdoc/>
  9. protected override void DeleteTextBackwards () { ((TextView)HostControl!).DeleteCharLeft (); }
  10. /// <inheritdoc/>
  11. protected override void InsertText (string accepted) { ((TextView)HostControl!).InsertText (accepted); }
  12. /// <inheritdoc/>
  13. protected override void SetCursorPosition (int column)
  14. {
  15. ((TextView)HostControl!).CursorPosition =
  16. new (column, ((TextView)HostControl).CurrentRow);
  17. }
  18. }