Просмотр исходного кода

Removes `Terminal` from public Buffer API

This pulls too much noise into the Mocks and isn't really needed (from a functional POV)
devmil 4 лет назад
Родитель
Сommit
66b08316c5

+ 61 - 58
lib/buffer/buffer.dart

@@ -11,23 +11,26 @@ import 'package:xterm/util/unicode_v11.dart';
 
 class Buffer {
   Buffer({
-    required this.terminal,
+    required Terminal terminal,
     required this.isAltBuffer,
-  }) {
+  }) : _terminal = terminal {
     resetVerticalMargins();
 
     lines = CircularList(
-      terminal.maxLines,
+      _terminal.maxLines,
     );
-    for (int i = 0; i < terminal.viewHeight; i++) {
+    for (int i = 0; i < _terminal.viewHeight; i++) {
       lines.push(_newEmptyLine());
     }
   }
 
-  final Terminal terminal;
+  final Terminal _terminal;
   final bool isAltBuffer;
   final charset = Charset();
 
+  int get viewHeight => _terminal.viewHeight;
+  int get viewWidth => _terminal.viewWidth;
+
   /// lines of the buffer. the length of [lines] should always be equal or
   /// greater than [Terminal.viewHeight].
   late final CircularList<BufferLine> lines;
@@ -46,7 +49,7 @@ class Buffer {
   // Indicates how far the top of the viewport is from the top of the entire
   // buffer. 0 if the viewport is scrolled to the top.
   int get scrollOffsetFromTop {
-    return terminal.invisibleHeight - scrollOffsetFromBottom;
+    return _terminal.invisibleHeight - scrollOffsetFromBottom;
   }
 
   /// Indicated whether the terminal should automatically scroll to bottom when
@@ -58,7 +61,7 @@ class Buffer {
 
   /// Horizontal position of the cursor relative to the top-left cornor of the
   /// screen, starting from 0.
-  int get cursorX => _cursorX.clamp(0, terminal.viewWidth - 1);
+  int get cursorX => _cursorX.clamp(0, _terminal.viewWidth - 1);
   int _cursorX = 0;
 
   /// Vertical position of the cursor relative to the top-left cornor of the
@@ -72,7 +75,7 @@ class Buffer {
   int get marginBottom => _marginBottom;
   late int _marginBottom;
 
-  /// Writes data to the terminal. Terminal sequences or special characters are
+  /// Writes data to the _terminal. Terminal sequences or special characters are
   /// not interpreted and directly added to the buffer.
   ///
   /// See also: [Terminal.write]
@@ -82,7 +85,7 @@ class Buffer {
     }
   }
 
-  /// Writes a single character to the terminal. Special chatacters are not
+  /// Writes a single character to the _terminal. Special chatacters are not
   /// interpreted and directly added to the buffer.
   ///
   /// See also: [Terminal.writeChar]
@@ -90,10 +93,10 @@ class Buffer {
     codePoint = charset.translate(codePoint);
 
     final cellWidth = unicodeV11.wcwidth(codePoint);
-    if (_cursorX >= terminal.viewWidth) {
+    if (_cursorX >= _terminal.viewWidth) {
       newLine();
       setCursorX(0);
-      if (terminal.autoWrapMode) {
+      if (_terminal.autoWrapMode) {
         currentLine.isWrapped = true;
       }
     }
@@ -105,10 +108,10 @@ class Buffer {
       _cursorX,
       content: codePoint,
       width: cellWidth,
-      cursor: terminal.cursor,
+      cursor: _terminal.cursor,
     );
 
-    if (_cursorX < terminal.viewWidth) {
+    if (_cursorX < _terminal.viewWidth) {
       _cursorX++;
     }
 
@@ -120,7 +123,7 @@ class Buffer {
   /// get line in the viewport. [index] starts from 0, must be smaller than
   /// [Terminal.viewHeight].
   BufferLine getViewLine(int index) {
-    index = index.clamp(0, terminal.viewHeight - 1);
+    index = index.clamp(0, _terminal.viewHeight - 1);
     return lines[convertViewLineToRawLine(index)];
   }
 
@@ -133,23 +136,23 @@ class Buffer {
   }
 
   int convertViewLineToRawLine(int viewLine) {
-    if (terminal.viewHeight > height) {
+    if (_terminal.viewHeight > height) {
       return viewLine;
     }
 
-    return viewLine + (height - terminal.viewHeight);
+    return viewLine + (height - _terminal.viewHeight);
   }
 
   int convertRawLineToViewLine(int rawLine) {
-    if (terminal.viewHeight > height) {
+    if (_terminal.viewHeight > height) {
       return rawLine;
     }
 
-    return rawLine - (height - terminal.viewHeight);
+    return rawLine - (height - _terminal.viewHeight);
   }
 
   void newLine() {
-    if (terminal.newLineMode) {
+    if (_terminal.newLineMode) {
       setCursorX(0);
     }
 
@@ -163,8 +166,8 @@ class Buffer {
   void backspace() {
     if (_cursorX == 0 && currentLine.isWrapped) {
       currentLine.isWrapped = false;
-      movePosition(terminal.viewWidth - 1, -1);
-    } else if (_cursorX == terminal.viewWidth) {
+      movePosition(_terminal.viewWidth - 1, -1);
+    } else if (_cursorX == _terminal.viewWidth) {
       movePosition(-2, 0);
     } else {
       movePosition(-1, 0);
@@ -172,13 +175,13 @@ class Buffer {
   }
 
   List<BufferLine> getVisibleLines() {
-    if (height < terminal.viewHeight) {
+    if (height < _terminal.viewHeight) {
       return lines.toList();
     }
 
     final result = <BufferLine>[];
 
-    for (var i = height - terminal.viewHeight; i < height; i++) {
+    for (var i = height - _terminal.viewHeight; i < height; i++) {
       final y = i - scrollOffsetFromBottom;
       if (y >= 0 && y < height) {
         result.add(lines[y]);
@@ -191,10 +194,10 @@ class Buffer {
   void eraseDisplayFromCursor() {
     eraseLineFromCursor();
 
-    for (var i = _cursorY + 1; i < terminal.viewHeight; i++) {
+    for (var i = _cursorY + 1; i < _terminal.viewHeight; i++) {
       final line = getViewLine(i);
       line.isWrapped = false;
-      line.erase(terminal.cursor, 0, terminal.viewWidth);
+      line.erase(_terminal.cursor, 0, _terminal.viewWidth);
     }
   }
 
@@ -204,36 +207,36 @@ class Buffer {
     for (var i = 0; i < _cursorY; i++) {
       final line = getViewLine(i);
       line.isWrapped = false;
-      line.erase(terminal.cursor, 0, terminal.viewWidth);
+      line.erase(_terminal.cursor, 0, _terminal.viewWidth);
     }
   }
 
   void eraseDisplay() {
-    for (var i = 0; i < terminal.viewHeight; i++) {
+    for (var i = 0; i < _terminal.viewHeight; i++) {
       final line = getViewLine(i);
       line.isWrapped = false;
-      line.erase(terminal.cursor, 0, terminal.viewWidth);
+      line.erase(_terminal.cursor, 0, _terminal.viewWidth);
     }
   }
 
   void eraseLineFromCursor() {
     currentLine.isWrapped = false;
-    currentLine.erase(terminal.cursor, _cursorX, terminal.viewWidth);
+    currentLine.erase(_terminal.cursor, _cursorX, _terminal.viewWidth);
   }
 
   void eraseLineToCursor() {
     currentLine.isWrapped = false;
-    currentLine.erase(terminal.cursor, 0, _cursorX);
+    currentLine.erase(_terminal.cursor, 0, _cursorX);
   }
 
   void eraseLine() {
     currentLine.isWrapped = false;
-    currentLine.erase(terminal.cursor, 0, terminal.viewWidth);
+    currentLine.erase(_terminal.cursor, 0, _terminal.viewWidth);
   }
 
   void eraseCharacters(int count) {
     final start = _cursorX;
-    currentLine.erase(terminal.cursor, start, start + count);
+    currentLine.erase(_terminal.cursor, start, start + count);
   }
 
   ScrollRange getAreaScrollRange() {
@@ -288,7 +291,7 @@ class Buffer {
     }
 
     // the cursor is not in the scrollable region
-    if (_cursorY >= terminal.viewHeight - 1) {
+    if (_cursorY >= _terminal.viewHeight - 1) {
       // we are at the bottom so a new line is created.
       lines.push(_newEmptyLine());
 
@@ -316,11 +319,11 @@ class Buffer {
   }
 
   void setCursorX(int cursorX) {
-    _cursorX = cursorX.clamp(0, terminal.viewWidth - 1);
+    _cursorX = cursorX.clamp(0, _terminal.viewWidth - 1);
   }
 
   void setCursorY(int cursorY) {
-    _cursorY = cursorY.clamp(0, terminal.viewHeight - 1);
+    _cursorY = cursorY.clamp(0, _terminal.viewHeight - 1);
   }
 
   void moveCursorX(int offset) {
@@ -332,14 +335,14 @@ class Buffer {
   }
 
   void setPosition(int cursorX, int cursorY) {
-    var maxLine = terminal.viewHeight - 1;
+    var maxLine = _terminal.viewHeight - 1;
 
-    if (terminal.originMode) {
+    if (_terminal.originMode) {
       cursorY += _marginTop;
       maxLine = _marginBottom;
     }
 
-    _cursorX = cursorX.clamp(0, terminal.viewWidth - 1);
+    _cursorX = cursorX.clamp(0, _terminal.viewWidth - 1);
     _cursorY = cursorY.clamp(0, maxLine);
   }
 
@@ -350,13 +353,13 @@ class Buffer {
   }
 
   void setScrollOffsetFromBottom(int offsetFromBottom) {
-    if (height < terminal.viewHeight) return;
-    final maxOffsetFromBottom = height - terminal.viewHeight;
+    if (height < _terminal.viewHeight) return;
+    final maxOffsetFromBottom = height - _terminal.viewHeight;
     _scrollOffsetFromBottom = offsetFromBottom.clamp(0, maxOffsetFromBottom);
   }
 
   void setScrollOffsetFromTop(int offsetFromTop) {
-    final bottomOffset = terminal.invisibleHeight - offsetFromTop;
+    final bottomOffset = _terminal.invisibleHeight - offsetFromTop;
     setScrollOffsetFromBottom(bottomOffset);
   }
 
@@ -369,9 +372,9 @@ class Buffer {
   }
 
   void saveCursor() {
-    _savedCellFlags = terminal.cursor.flags;
-    _savedCellFgColor = terminal.cursor.fg;
-    _savedCellBgColor = terminal.cursor.bg;
+    _savedCellFlags = _terminal.cursor.flags;
+    _savedCellFgColor = _terminal.cursor.fg;
+    _savedCellBgColor = _terminal.cursor.bg;
     _savedCursorX = _cursorX;
     _savedCursorY = _cursorY;
     charset.save();
@@ -379,15 +382,15 @@ class Buffer {
 
   void restoreCursor() {
     if (_savedCellFlags != null) {
-      terminal.cursor.flags = _savedCellFlags!;
+      _terminal.cursor.flags = _savedCellFlags!;
     }
 
     if (_savedCellFgColor != null) {
-      terminal.cursor.fg = _savedCellFgColor!;
+      _terminal.cursor.fg = _savedCellFgColor!;
     }
 
     if (_savedCellBgColor != null) {
-      terminal.cursor.bg = _savedCellBgColor!;
+      _terminal.cursor.bg = _savedCellBgColor!;
     }
 
     if (_savedCursorX != null) {
@@ -402,15 +405,15 @@ class Buffer {
   }
 
   void setVerticalMargins(int top, int bottom) {
-    _marginTop = top.clamp(0, terminal.viewHeight - 1);
-    _marginBottom = bottom.clamp(0, terminal.viewHeight - 1);
+    _marginTop = top.clamp(0, _terminal.viewHeight - 1);
+    _marginBottom = bottom.clamp(0, _terminal.viewHeight - 1);
 
     _marginTop = min(_marginTop, _marginBottom);
     _marginBottom = max(_marginTop, _marginBottom);
   }
 
   bool get hasScrollableRegion {
-    return _marginTop > 0 || _marginBottom < (terminal.viewHeight - 1);
+    return _marginTop > 0 || _marginBottom < (_terminal.viewHeight - 1);
   }
 
   bool get isInScrollableRegion {
@@ -420,26 +423,26 @@ class Buffer {
   }
 
   void resetVerticalMargins() {
-    setVerticalMargins(0, terminal.viewHeight - 1);
+    setVerticalMargins(0, _terminal.viewHeight - 1);
   }
 
   void deleteChars(int count) {
-    final start = _cursorX.clamp(0, terminal.viewWidth);
-    final end = min(_cursorX + count, terminal.viewWidth);
+    final start = _cursorX.clamp(0, _terminal.viewWidth);
+    final end = min(_cursorX + count, _terminal.viewWidth);
     currentLine.removeRange(start, end);
   }
 
   void clearScrollback() {
-    if (lines.length <= terminal.viewHeight) {
+    if (lines.length <= _terminal.viewHeight) {
       return;
     }
 
-    lines.trimStart(lines.length - terminal.viewHeight);
+    lines.trimStart(lines.length - _terminal.viewHeight);
   }
 
   void clear() {
     lines.clear();
-    for (int i = 0; i < terminal.viewHeight; i++) {
+    for (int i = 0; i < _terminal.viewHeight; i++) {
       lines.push(_newEmptyLine());
     }
   }
@@ -447,7 +450,7 @@ class Buffer {
   void insertBlankCharacters(int count) {
     for (var i = 0; i < count; i++) {
       currentLine.insert(_cursorX + i);
-      currentLine.cellSetFlags(_cursorX + i, terminal.cursor.flags);
+      currentLine.cellSetFlags(_cursorX + i, _terminal.cursor.flags);
     }
   }
 
@@ -537,7 +540,7 @@ class Buffer {
   }
 
   BufferLine _newEmptyLine() {
-    final line = BufferLine(length: terminal.viewWidth);
+    final line = BufferLine(length: _terminal.viewWidth);
     return line;
   }
 

+ 2 - 2
lib/buffer/reflow_strategy_wider.dart

@@ -67,8 +67,8 @@ class ReflowStrategyWider extends ReflowStrategy {
       i += linesToSkip;
     }
     //buffer doesn't have enough lines
-    while (linesAfterReflow.length < buffer.terminal.viewHeight) {
-      linesAfterReflow.add(BufferLine(length: buffer.terminal.viewWidth));
+    while (linesAfterReflow.length < buffer.viewHeight) {
+      linesAfterReflow.add(BufferLine(length: buffer.viewWidth));
     }
 
     buffer.lines.replaceWith(linesAfterReflow);

+ 56 - 54
test/terminal/terminal_search_test.mocks.dart

@@ -4,15 +4,14 @@
 
 import 'package:mockito/mockito.dart' as _i1;
 import 'package:xterm/buffer/buffer.dart' as _i2;
-import 'package:xterm/buffer/line/line.dart' as _i6;
-import 'package:xterm/terminal/charset.dart' as _i4;
-import 'package:xterm/terminal/cursor.dart' as _i10;
-import 'package:xterm/terminal/terminal.dart' as _i3;
-import 'package:xterm/terminal/terminal_search_interaction.dart' as _i8;
-import 'package:xterm/util/circular_list.dart' as _i5;
-import 'package:xterm/util/scroll_range.dart' as _i7;
+import 'package:xterm/buffer/line/line.dart' as _i5;
+import 'package:xterm/terminal/charset.dart' as _i3;
+import 'package:xterm/terminal/cursor.dart' as _i9;
+import 'package:xterm/terminal/terminal_search_interaction.dart' as _i7;
+import 'package:xterm/util/circular_list.dart' as _i4;
+import 'package:xterm/util/scroll_range.dart' as _i6;
 
-import 'terminal_search_test.dart' as _i9;
+import 'terminal_search_test.dart' as _i8;
 
 // ignore_for_file: avoid_redundant_argument_values
 // ignore_for_file: avoid_setters_without_getters
@@ -24,23 +23,21 @@ import 'terminal_search_test.dart' as _i9;
 
 class _FakeBuffer_0 extends _i1.Fake implements _i2.Buffer {}
 
-class _FakeTerminal_1 extends _i1.Fake implements _i3.Terminal {}
+class _FakeCharset_1 extends _i1.Fake implements _i3.Charset {}
 
-class _FakeCharset_2 extends _i1.Fake implements _i4.Charset {}
+class _FakeCircularList_2<T> extends _i1.Fake implements _i4.CircularList<T> {}
 
-class _FakeCircularList_3<T> extends _i1.Fake implements _i5.CircularList<T> {}
+class _FakeBufferLine_3 extends _i1.Fake implements _i5.BufferLine {}
 
-class _FakeBufferLine_4 extends _i1.Fake implements _i6.BufferLine {}
+class _FakeScrollRange_4 extends _i1.Fake implements _i6.ScrollRange {}
 
-class _FakeScrollRange_5 extends _i1.Fake implements _i7.ScrollRange {}
-
-class _FakeBufferLineData_6 extends _i1.Fake implements _i6.BufferLineData {}
+class _FakeBufferLineData_5 extends _i1.Fake implements _i5.BufferLineData {}
 
 /// A class which mocks [TerminalSearchInteraction].
 ///
 /// See the documentation for Mockito's code generation for more information.
 class MockTerminalSearchInteraction extends _i1.Mock
-    implements _i8.TerminalSearchInteraction {
+    implements _i7.TerminalSearchInteraction {
   MockTerminalSearchInteraction() {
     _i1.throwOnMissingStub(this);
   }
@@ -68,26 +65,31 @@ class MockBuffer extends _i1.Mock implements _i2.Buffer {
     _i1.throwOnMissingStub(this);
   }
 
-  @override
-  _i3.Terminal get terminal => (super.noSuchMethod(Invocation.getter(#terminal),
-      returnValue: _FakeTerminal_1()) as _i3.Terminal);
   @override
   bool get isAltBuffer =>
       (super.noSuchMethod(Invocation.getter(#isAltBuffer), returnValue: false)
           as bool);
   @override
-  _i4.Charset get charset => (super.noSuchMethod(Invocation.getter(#charset),
-      returnValue: _FakeCharset_2()) as _i4.Charset);
+  _i3.Charset get charset => (super.noSuchMethod(Invocation.getter(#charset),
+      returnValue: _FakeCharset_1()) as _i3.Charset);
   @override
-  _i5.CircularList<_i6.BufferLine> get lines =>
+  _i4.CircularList<_i5.BufferLine> get lines =>
       (super.noSuchMethod(Invocation.getter(#lines),
-              returnValue: _FakeCircularList_3<_i6.BufferLine>())
-          as _i5.CircularList<_i6.BufferLine>);
+              returnValue: _FakeCircularList_2<_i5.BufferLine>())
+          as _i4.CircularList<_i5.BufferLine>);
   @override
-  set lines(_i5.CircularList<_i6.BufferLine>? _lines) =>
+  set lines(_i4.CircularList<_i5.BufferLine>? _lines) =>
       super.noSuchMethod(Invocation.setter(#lines, _lines),
           returnValueForMissingStub: null);
   @override
+  int get viewHeight =>
+      (super.noSuchMethod(Invocation.getter(#viewHeight), returnValue: 0)
+          as int);
+  @override
+  int get viewWidth =>
+      (super.noSuchMethod(Invocation.getter(#viewWidth), returnValue: 0)
+          as int);
+  @override
   int get scrollOffsetFromBottom =>
       (super.noSuchMethod(Invocation.getter(#scrollOffsetFromBottom),
           returnValue: 0) as int);
@@ -114,9 +116,9 @@ class MockBuffer extends _i1.Mock implements _i2.Buffer {
       (super.noSuchMethod(Invocation.getter(#marginBottom), returnValue: 0)
           as int);
   @override
-  _i6.BufferLine get currentLine =>
+  _i5.BufferLine get currentLine =>
       (super.noSuchMethod(Invocation.getter(#currentLine),
-          returnValue: _FakeBufferLine_4()) as _i6.BufferLine);
+          returnValue: _FakeBufferLine_3()) as _i5.BufferLine);
   @override
   int get height =>
       (super.noSuchMethod(Invocation.getter(#height), returnValue: 0) as int);
@@ -137,9 +139,9 @@ class MockBuffer extends _i1.Mock implements _i2.Buffer {
       super.noSuchMethod(Invocation.method(#writeChar, [codePoint]),
           returnValueForMissingStub: null);
   @override
-  _i6.BufferLine getViewLine(int? index) =>
+  _i5.BufferLine getViewLine(int? index) =>
       (super.noSuchMethod(Invocation.method(#getViewLine, [index]),
-          returnValue: _FakeBufferLine_4()) as _i6.BufferLine);
+          returnValue: _FakeBufferLine_3()) as _i5.BufferLine);
   @override
   int convertViewLineToRawLine(int? viewLine) => (super.noSuchMethod(
       Invocation.method(#convertViewLineToRawLine, [viewLine]),
@@ -159,9 +161,9 @@ class MockBuffer extends _i1.Mock implements _i2.Buffer {
   void backspace() => super.noSuchMethod(Invocation.method(#backspace, []),
       returnValueForMissingStub: null);
   @override
-  List<_i6.BufferLine> getVisibleLines() =>
+  List<_i5.BufferLine> getVisibleLines() =>
       (super.noSuchMethod(Invocation.method(#getVisibleLines, []),
-          returnValue: <_i6.BufferLine>[]) as List<_i6.BufferLine>);
+          returnValue: <_i5.BufferLine>[]) as List<_i5.BufferLine>);
   @override
   void eraseDisplayFromCursor() =>
       super.noSuchMethod(Invocation.method(#eraseDisplayFromCursor, []),
@@ -190,9 +192,9 @@ class MockBuffer extends _i1.Mock implements _i2.Buffer {
       super.noSuchMethod(Invocation.method(#eraseCharacters, [count]),
           returnValueForMissingStub: null);
   @override
-  _i7.ScrollRange getAreaScrollRange() =>
+  _i6.ScrollRange getAreaScrollRange() =>
       (super.noSuchMethod(Invocation.method(#getAreaScrollRange, []),
-          returnValue: _FakeScrollRange_5()) as _i7.ScrollRange);
+          returnValue: _FakeScrollRange_4()) as _i6.ScrollRange);
   @override
   void areaScrollDown(int? lines) =>
       super.noSuchMethod(Invocation.method(#areaScrollDown, [lines]),
@@ -313,7 +315,7 @@ class MockBuffer extends _i1.Mock implements _i2.Buffer {
 ///
 /// See the documentation for Mockito's code generation for more information.
 class MockTerminalSearchTestCircularList extends _i1.Mock
-    implements _i9.TerminalSearchTestCircularList {
+    implements _i8.TerminalSearchTestCircularList {
   MockTerminalSearchTestCircularList() {
     _i1.throwOnMissingStub(this);
   }
@@ -338,41 +340,41 @@ class MockTerminalSearchTestCircularList extends _i1.Mock
       (super.noSuchMethod(Invocation.getter(#isFull), returnValue: false)
           as bool);
   @override
-  void forEach(void Function(_i6.BufferLine)? callback) =>
+  void forEach(void Function(_i5.BufferLine)? callback) =>
       super.noSuchMethod(Invocation.method(#forEach, [callback]),
           returnValueForMissingStub: null);
   @override
-  _i6.BufferLine operator [](int? index) =>
+  _i5.BufferLine operator [](int? index) =>
       (super.noSuchMethod(Invocation.method(#[], [index]),
-          returnValue: _FakeBufferLine_4()) as _i6.BufferLine);
+          returnValue: _FakeBufferLine_3()) as _i5.BufferLine);
   @override
-  void operator []=(int? index, _i6.BufferLine? value) =>
+  void operator []=(int? index, _i5.BufferLine? value) =>
       super.noSuchMethod(Invocation.method(#[]=, [index, value]),
           returnValueForMissingStub: null);
   @override
   void clear() => super.noSuchMethod(Invocation.method(#clear, []),
       returnValueForMissingStub: null);
   @override
-  void pushAll(Iterable<_i6.BufferLine>? items) =>
+  void pushAll(Iterable<_i5.BufferLine>? items) =>
       super.noSuchMethod(Invocation.method(#pushAll, [items]),
           returnValueForMissingStub: null);
   @override
-  void push(_i6.BufferLine? value) =>
+  void push(_i5.BufferLine? value) =>
       super.noSuchMethod(Invocation.method(#push, [value]),
           returnValueForMissingStub: null);
   @override
-  _i6.BufferLine pop() => (super.noSuchMethod(Invocation.method(#pop, []),
-      returnValue: _FakeBufferLine_4()) as _i6.BufferLine);
+  _i5.BufferLine pop() => (super.noSuchMethod(Invocation.method(#pop, []),
+      returnValue: _FakeBufferLine_3()) as _i5.BufferLine);
   @override
   void remove(int? index, [int? count = 1]) =>
       super.noSuchMethod(Invocation.method(#remove, [index, count]),
           returnValueForMissingStub: null);
   @override
-  void insert(int? index, _i6.BufferLine? item) =>
+  void insert(int? index, _i5.BufferLine? item) =>
       super.noSuchMethod(Invocation.method(#insert, [index, item]),
           returnValueForMissingStub: null);
   @override
-  void insertAll(int? index, List<_i6.BufferLine>? items) =>
+  void insertAll(int? index, List<_i5.BufferLine>? items) =>
       super.noSuchMethod(Invocation.method(#insertAll, [index, items]),
           returnValueForMissingStub: null);
   @override
@@ -384,13 +386,13 @@ class MockTerminalSearchTestCircularList extends _i1.Mock
       Invocation.method(#shiftElements, [start, count, offset]),
       returnValueForMissingStub: null);
   @override
-  void replaceWith(List<_i6.BufferLine>? replacement) =>
+  void replaceWith(List<_i5.BufferLine>? replacement) =>
       super.noSuchMethod(Invocation.method(#replaceWith, [replacement]),
           returnValueForMissingStub: null);
   @override
-  List<_i6.BufferLine> toList() =>
+  List<_i5.BufferLine> toList() =>
       (super.noSuchMethod(Invocation.method(#toList, []),
-          returnValue: <_i6.BufferLine>[]) as List<_i6.BufferLine>);
+          returnValue: <_i5.BufferLine>[]) as List<_i5.BufferLine>);
   @override
   String toString() => super.toString();
 }
@@ -398,14 +400,14 @@ class MockTerminalSearchTestCircularList extends _i1.Mock
 /// A class which mocks [BufferLine].
 ///
 /// See the documentation for Mockito's code generation for more information.
-class MockBufferLine extends _i1.Mock implements _i6.BufferLine {
+class MockBufferLine extends _i1.Mock implements _i5.BufferLine {
   MockBufferLine() {
     _i1.throwOnMissingStub(this);
   }
 
   @override
-  _i6.BufferLineData get data => (super.noSuchMethod(Invocation.getter(#data),
-      returnValue: _FakeBufferLineData_6()) as _i6.BufferLineData);
+  _i5.BufferLineData get data => (super.noSuchMethod(Invocation.getter(#data),
+      returnValue: _FakeBufferLineData_5()) as _i5.BufferLineData);
   @override
   bool get isWrapped =>
       (super.noSuchMethod(Invocation.getter(#isWrapped), returnValue: false)
@@ -446,7 +448,7 @@ class MockBufferLine extends _i1.Mock implements _i6.BufferLine {
   void clear() => super.noSuchMethod(Invocation.method(#clear, []),
       returnValueForMissingStub: null);
   @override
-  void erase(_i10.Cursor? cursor, int? start, int? end,
+  void erase(_i9.Cursor? cursor, int? start, int? end,
           [bool? resetIsWrapped = false]) =>
       super.noSuchMethod(
           Invocation.method(#erase, [cursor, start, end, resetIsWrapped]),
@@ -457,7 +459,7 @@ class MockBufferLine extends _i1.Mock implements _i6.BufferLine {
           returnValueForMissingStub: null);
   @override
   void cellInitialize(int? index,
-          {int? content, int? width, _i10.Cursor? cursor}) =>
+          {int? content, int? width, _i9.Cursor? cursor}) =>
       super.noSuchMethod(
           Invocation.method(#cellInitialize, [index],
               {#content: content, #width: width, #cursor: cursor}),
@@ -519,7 +521,7 @@ class MockBufferLine extends _i1.Mock implements _i6.BufferLine {
       super.noSuchMethod(Invocation.method(#cellSetFlag, [index, flag]),
           returnValueForMissingStub: null);
   @override
-  void cellErase(int? index, _i10.Cursor? cursor) =>
+  void cellErase(int? index, _i9.Cursor? cursor) =>
       super.noSuchMethod(Invocation.method(#cellErase, [index, cursor]),
           returnValueForMissingStub: null);
   @override
@@ -527,7 +529,7 @@ class MockBufferLine extends _i1.Mock implements _i6.BufferLine {
       (super.noSuchMethod(Invocation.method(#getTrimmedLength, [cols]),
           returnValue: 0) as int);
   @override
-  void copyCellsFrom(_i6.BufferLine? src, int? srcCol, int? dstCol, int? len) =>
+  void copyCellsFrom(_i5.BufferLine? src, int? srcCol, int? dstCol, int? len) =>
       super.noSuchMethod(
           Invocation.method(#copyCellsFrom, [src, srcCol, dstCol, len]),
           returnValueForMissingStub: null);