|
|
@@ -17,6 +17,9 @@ class TerminalController with ChangeNotifier {
|
|
|
TerminalController({SelectionMode selectionMode = SelectionMode.line})
|
|
|
: _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) {
|
|
|
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) {
|
|
|
// If the new mode is the same as the old mode,
|
|
|
// nothing has to be changed.
|
|
|
@@ -58,6 +64,7 @@ class TerminalController with ChangeNotifier {
|
|
|
setSelection(_modeRange(selection.begin, selection.end));
|
|
|
}
|
|
|
|
|
|
+ /// Clears the current selection.
|
|
|
void clearSelection() {
|
|
|
_selection = null;
|
|
|
notifyListeners();
|