2
0

AutocompleteContext.cs 817 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections.Generic;
  2. using Rune = System.Rune;
  3. namespace Terminal.Gui {
  4. /// <summary>
  5. /// Describes the current state of a <see cref="View"/> which
  6. /// is proposing autocomplete. Suggestions are based on this state.
  7. /// </summary>
  8. public class AutocompleteContext
  9. {
  10. /// <summary>
  11. /// The text on the current line.
  12. /// </summary>
  13. public List<Rune> CurrentLine { get; set; }
  14. /// <summary>
  15. /// The position of the input cursor within the <see cref="CurrentLine"/>.
  16. /// </summary>
  17. public int CursorPosition { get; set; }
  18. /// <summary>
  19. /// Creates anew instance of the <see cref="AutocompleteContext"/> class
  20. /// </summary>
  21. public AutocompleteContext (List<Rune> currentLine, int cursorPosition)
  22. {
  23. CurrentLine = currentLine;
  24. CursorPosition = cursorPosition;
  25. }
  26. }
  27. }