xuty 3 лет назад
Родитель
Сommit
7730b13f23
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      lib/src/ui/controller.dart

+ 7 - 0
lib/src/ui/controller.dart

@@ -17,6 +17,9 @@ class TerminalController with ChangeNotifier {
   TerminalController({SelectionMode selectionMode = SelectionMode.line})
   TerminalController({SelectionMode selectionMode = SelectionMode.line})
       : _selectionMode = selectionMode;
       : _selectionMode = selectionMode;
 
 
+  /// Set selection on the terminal to [range]. For now [range] could be either
+  /// a [BufferRangeLine] or a [BufferRangeBlock]. This is not effected by
+  /// [selectionMode].
   void setSelection(BufferRange? range) {
   void setSelection(BufferRange? range) {
     range = range?.normalized;
     range = range?.normalized;
 
 
@@ -40,6 +43,9 @@ class TerminalController with ChangeNotifier {
     }
     }
   }
   }
 
 
+  /// Controls how the terminal behaves when the user selects a range of text.
+  /// The default is [SelectionMode.line]. Setting this to [SelectionMode.block]
+  /// enables block selection mode.
   void setSelectionMode(SelectionMode newSelectionMode) {
   void setSelectionMode(SelectionMode newSelectionMode) {
     // If the new mode is the same as the old mode,
     // If the new mode is the same as the old mode,
     // nothing has to be changed.
     // nothing has to be changed.
@@ -58,6 +64,7 @@ class TerminalController with ChangeNotifier {
     setSelection(_modeRange(selection.begin, selection.end));
     setSelection(_modeRange(selection.begin, selection.end));
   }
   }
 
 
+  /// Clears the current selection.
   void clearSelection() {
   void clearSelection() {
     _selection = null;
     _selection = null;
     notifyListeners();
     notifyListeners();