AutocompleteContext.cs 916 B

12345678910111213141516171819202122232425
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Describes the current state of a <see cref="View"/> which is proposing autocomplete. Suggestions are based on
  4. /// this state.
  5. /// </summary>
  6. public class AutocompleteContext
  7. {
  8. /// <summary>Creates a new instance of the <see cref="AutocompleteContext"/> class</summary>
  9. public AutocompleteContext (List<Cell> currentLine, int cursorPosition, bool canceled = false)
  10. {
  11. CurrentLine = currentLine;
  12. CursorPosition = cursorPosition;
  13. Canceled = canceled;
  14. }
  15. /// <summary>Gets or sets if the autocomplete was canceled from popup.</summary>
  16. public bool Canceled { get; set; }
  17. /// <summary>The text on the current line.</summary>
  18. public List<Cell> CurrentLine { get; set; }
  19. /// <summary>The position of the input cursor within the <see cref="CurrentLine"/>.</summary>
  20. public int CursorPosition { get; set; }
  21. }