recordInput method

void recordInput(
  1. String input
)

Record a user input for history-based completions.

Implementation

void recordInput(String input) {
  if (input.isEmpty || input.startsWith('/')) return;
  _recentInputs.remove(input); // Remove duplicate.
  _recentInputs.insert(0, input);
  if (_recentInputs.length > _maxRecentInputs) {
    _recentInputs.removeLast();
  }
}