format the tree to current dart format spec
Mechanical `dart format` sweep across files that drifted from the formatter's output (mostly trailing-comma and line-wrap differences from a Dart SDK / formatter version bump). No semantic changes. Caught because the pre-push gate now actually fires. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"exported_at": "2026-05-06T20:28:25Z",
|
||||
"exported_at": "2026-05-06T20:28:51Z",
|
||||
"decisions": [
|
||||
{
|
||||
"id": "D-1",
|
||||
|
||||
@@ -129,9 +129,7 @@ class _ClaudePaneState extends State<ClaudePane> {
|
||||
repoRoot = (rootResp.data['path'] as String?) ?? repoRoot;
|
||||
}
|
||||
|
||||
_sessionName = widget.isPrimary
|
||||
? primarySessionName(repoRoot)
|
||||
: secondarySessionName(repoRoot, widget.secondaryIndex!);
|
||||
_sessionName = widget.isPrimary ? primarySessionName(repoRoot) : secondarySessionName(repoRoot, widget.secondaryIndex!);
|
||||
|
||||
final tmuxConf = await _ensureTmuxConf();
|
||||
final cols = _terminal.viewWidth;
|
||||
@@ -139,7 +137,8 @@ class _ClaudePaneState extends State<ClaudePane> {
|
||||
|
||||
var argv = <String>[
|
||||
'tmux',
|
||||
'-L', 'clide',
|
||||
'-L',
|
||||
'clide',
|
||||
if (tmuxConf != null) ...['-f', tmuxConf],
|
||||
'new-session',
|
||||
'-A',
|
||||
@@ -220,9 +219,7 @@ class _ClaudePaneState extends State<ClaudePane> {
|
||||
}
|
||||
}
|
||||
case 'pane.exit':
|
||||
setState(() => _statusLine = widget.isPrimary
|
||||
? 'session exited — restart clide to retry'
|
||||
: 'session exited');
|
||||
setState(() => _statusLine = widget.isPrimary ? 'session exited — restart clide to retry' : 'session exited');
|
||||
case 'pane.closed':
|
||||
_paneId = null;
|
||||
}
|
||||
@@ -252,10 +249,15 @@ class _ClaudePaneState extends State<ClaudePane> {
|
||||
_ipc()?.request('pane.resize', args: {'id': id, 'cols': cols, 'rows': rows});
|
||||
if (_sessionName != null) {
|
||||
Process.run('tmux', [
|
||||
'-L', 'clide', 'resize-window',
|
||||
'-t', _sessionName!,
|
||||
'-x', '$cols',
|
||||
'-y', '$rows',
|
||||
'-L',
|
||||
'clide',
|
||||
'resize-window',
|
||||
'-t',
|
||||
_sessionName!,
|
||||
'-x',
|
||||
'$cols',
|
||||
'-y',
|
||||
'$rows',
|
||||
]);
|
||||
}
|
||||
});
|
||||
@@ -277,9 +279,7 @@ class _ClaudePaneState extends State<ClaudePane> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final title = widget.isPrimary
|
||||
? 'claude — primary'
|
||||
: 'claude — secondary ${widget.secondaryIndex}';
|
||||
final title = widget.isPrimary ? 'claude — primary' : 'claude — secondary ${widget.secondaryIndex}';
|
||||
|
||||
final body = _error != null
|
||||
? Padding(
|
||||
|
||||
@@ -14,8 +14,7 @@ typedef TmuxRunner = Future<ProcessResult> Function(List<String> args);
|
||||
|
||||
TmuxRunner tmuxRunner = _defaultRunner;
|
||||
|
||||
Future<ProcessResult> _defaultRunner(List<String> args) =>
|
||||
Process.run('tmux', args);
|
||||
Future<ProcessResult> _defaultRunner(List<String> args) => Process.run('tmux', args);
|
||||
|
||||
const _socket = ['-L', 'clide'];
|
||||
|
||||
@@ -30,11 +29,7 @@ Future<void> killSession(String name) async {
|
||||
Future<List<String>> listClideSessions() async {
|
||||
final r = await tmuxRunner([..._socket, 'list-sessions', '-F', '#{session_name}']);
|
||||
if (r.exitCode != 0) return const [];
|
||||
return (r.stdout as String)
|
||||
.split('\n')
|
||||
.map((s) => s.trim())
|
||||
.where((s) => s.isNotEmpty)
|
||||
.toList();
|
||||
return (r.stdout as String).split('\n').map((s) => s.trim()).where((s) => s.isNotEmpty).toList();
|
||||
}
|
||||
|
||||
/// Kill every secondary clide-claude session whose name begins with
|
||||
|
||||
@@ -54,8 +54,7 @@ class DaemonServer {
|
||||
// Probe by trying to connect — if a live peer answers, refuse
|
||||
// to start so we don't rip its socket out.
|
||||
try {
|
||||
final probe = await Socket.connect(addr, 0)
|
||||
.timeout(const Duration(milliseconds: 200));
|
||||
final probe = await Socket.connect(addr, 0).timeout(const Duration(milliseconds: 200));
|
||||
await probe.close();
|
||||
throw StateError('clide daemon already running at $socketPath');
|
||||
} on TimeoutException {
|
||||
|
||||
@@ -140,11 +140,9 @@ class NativePty {
|
||||
// Pre-allocate error envelopes the child will write to its stdout
|
||||
// (slave PTY → parent's master fd) before _exit, so the parent's
|
||||
// reader sees a real diagnostic instead of an indistinguishable EOF.
|
||||
final chdirErr = 'clide: chdir failed: $workingDirectory\n'
|
||||
.toNativeUtf8(allocator: malloc);
|
||||
final chdirErr = 'clide: chdir failed: $workingDirectory\n'.toNativeUtf8(allocator: malloc);
|
||||
final chdirErrLen = chdirErr.length;
|
||||
final execveErr = 'clide: exec failed: $executable\n'
|
||||
.toNativeUtf8(allocator: malloc);
|
||||
final execveErr = 'clide: exec failed: $executable\n'.toNativeUtf8(allocator: malloc);
|
||||
final execveErrLen = execveErr.length;
|
||||
|
||||
// Allocate ALL native memory before fork.
|
||||
|
||||
@@ -146,11 +146,7 @@ class PtySession {
|
||||
try {
|
||||
libc.setWinsize(masterFd, cols, rows);
|
||||
|
||||
final stdoutLine = await proc.stdout
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
.first
|
||||
.timeout(const Duration(seconds: 5));
|
||||
final stdoutLine = await proc.stdout.transform(const Utf8Decoder()).transform(const LineSplitter()).first.timeout(const Duration(seconds: 5));
|
||||
final pid = _extractPid(stdoutLine);
|
||||
|
||||
final code = await proc.exitCode;
|
||||
|
||||
@@ -572,9 +572,7 @@ class Buffer {
|
||||
continue;
|
||||
}
|
||||
final line = lines[segment.line];
|
||||
if (!(segment.line == range.begin.y ||
|
||||
segment.line == 0 ||
|
||||
line.isWrapped)) {
|
||||
if (!(segment.line == range.begin.y || segment.line == 0 || line.isWrapped)) {
|
||||
builder.write("\n");
|
||||
}
|
||||
builder.write(line.getText(segment.start, segment.end));
|
||||
|
||||
@@ -48,10 +48,5 @@ class CellOffset {
|
||||
int get hashCode => x.hashCode ^ y.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is CellOffset &&
|
||||
runtimeType == other.runtimeType &&
|
||||
x == other.x &&
|
||||
y == other.y;
|
||||
bool operator ==(Object other) => identical(this, other) || other is CellOffset && runtimeType == other.runtimeType && x == other.x && y == other.y;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ class BufferRangeLine extends BufferRange {
|
||||
@override
|
||||
bool contains(CellOffset position) {
|
||||
final self = normalized;
|
||||
return self.begin.isBeforeOrSame(position) &&
|
||||
self.end.isAfterOrSame(position);
|
||||
return self.begin.isBeforeOrSame(position) && self.end.isAfterOrSame(position);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -18,8 +18,7 @@ class BufferSegment {
|
||||
/// Should be greater than or equal to [start].
|
||||
final int? end;
|
||||
|
||||
const BufferSegment(this.range, this.line, this.start, this.end)
|
||||
: assert((start != null && end != null) ? start <= end : true);
|
||||
const BufferSegment(this.range, this.line, this.start, this.end) : assert((start != null && end != null) ? start <= end : true);
|
||||
|
||||
bool isWithin(CellOffset position) {
|
||||
if (position.y != line) {
|
||||
@@ -45,16 +44,10 @@ class BufferSegment {
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
range.hashCode ^ line.hashCode ^ start.hashCode ^ end.hashCode;
|
||||
int get hashCode => range.hashCode ^ line.hashCode ^ start.hashCode ^ end.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is BufferSegment &&
|
||||
runtimeType == other.runtimeType &&
|
||||
range == other.range &&
|
||||
line == other.line &&
|
||||
start == other.start &&
|
||||
end == other.end;
|
||||
other is BufferSegment && runtimeType == other.runtimeType && range == other.range && line == other.line && start == other.start && end == other.end;
|
||||
}
|
||||
|
||||
@@ -967,9 +967,7 @@ class EscapeParser {
|
||||
case 7:
|
||||
return handler.setAutoWrapMode(enabled);
|
||||
case 9:
|
||||
return enabled
|
||||
? handler.setMouseMode(MouseMode.clickOnly)
|
||||
: handler.setMouseMode(MouseMode.none);
|
||||
return enabled ? handler.setMouseMode(MouseMode.clickOnly) : handler.setMouseMode(MouseMode.none);
|
||||
case 12:
|
||||
case 13:
|
||||
return handler.setCursorBlinkMode(enabled);
|
||||
@@ -985,37 +983,23 @@ class EscapeParser {
|
||||
return handler.setAppKeypadMode(enabled);
|
||||
case 1000:
|
||||
case 10061000:
|
||||
return enabled
|
||||
? handler.setMouseMode(MouseMode.upDownScroll)
|
||||
: handler.setMouseMode(MouseMode.none);
|
||||
return enabled ? handler.setMouseMode(MouseMode.upDownScroll) : handler.setMouseMode(MouseMode.none);
|
||||
case 1001:
|
||||
return enabled
|
||||
? handler.setMouseMode(MouseMode.upDownScroll)
|
||||
: handler.setMouseMode(MouseMode.none);
|
||||
return enabled ? handler.setMouseMode(MouseMode.upDownScroll) : handler.setMouseMode(MouseMode.none);
|
||||
case 1002:
|
||||
return enabled
|
||||
? handler.setMouseMode(MouseMode.upDownScrollDrag)
|
||||
: handler.setMouseMode(MouseMode.none);
|
||||
return enabled ? handler.setMouseMode(MouseMode.upDownScrollDrag) : handler.setMouseMode(MouseMode.none);
|
||||
case 1003:
|
||||
return enabled
|
||||
? handler.setMouseMode(MouseMode.upDownScrollMove)
|
||||
: handler.setMouseMode(MouseMode.none);
|
||||
return enabled ? handler.setMouseMode(MouseMode.upDownScrollMove) : handler.setMouseMode(MouseMode.none);
|
||||
case 1004:
|
||||
return handler.setReportFocusMode(enabled);
|
||||
case 1005:
|
||||
return enabled
|
||||
? handler.setMouseReportMode(MouseReportMode.utf)
|
||||
: handler.setMouseReportMode(MouseReportMode.normal);
|
||||
return enabled ? handler.setMouseReportMode(MouseReportMode.utf) : handler.setMouseReportMode(MouseReportMode.normal);
|
||||
case 1006:
|
||||
return enabled
|
||||
? handler.setMouseReportMode(MouseReportMode.sgr)
|
||||
: handler.setMouseReportMode(MouseReportMode.normal);
|
||||
return enabled ? handler.setMouseReportMode(MouseReportMode.sgr) : handler.setMouseReportMode(MouseReportMode.normal);
|
||||
case 1007:
|
||||
return handler.setAltBufferMouseScrollMode(enabled);
|
||||
case 1015:
|
||||
return enabled
|
||||
? handler.setMouseReportMode(MouseReportMode.urxvt)
|
||||
: handler.setMouseReportMode(MouseReportMode.normal);
|
||||
return enabled ? handler.setMouseReportMode(MouseReportMode.urxvt) : handler.setMouseReportMode(MouseReportMode.normal);
|
||||
case 1047:
|
||||
if (enabled) {
|
||||
handler.useAltBuffer();
|
||||
|
||||
@@ -173,8 +173,7 @@ class CtrlInputHandler implements TerminalInputHandler {
|
||||
|
||||
final key = event.key;
|
||||
|
||||
if (key.index >= TerminalKey.keyA.index &&
|
||||
key.index <= TerminalKey.keyZ.index) {
|
||||
if (key.index >= TerminalKey.keyA.index && key.index <= TerminalKey.keyZ.index) {
|
||||
final input = key.index - TerminalKey.keyA.index + 1;
|
||||
return String.fromCharCode(input);
|
||||
}
|
||||
@@ -200,8 +199,7 @@ class AltInputHandler implements TerminalInputHandler {
|
||||
|
||||
final key = event.key;
|
||||
|
||||
if (key.index >= TerminalKey.keyA.index &&
|
||||
key.index <= TerminalKey.keyZ.index) {
|
||||
if (key.index >= TerminalKey.keyA.index && key.index <= TerminalKey.keyZ.index) {
|
||||
final charCode = key.index - TerminalKey.keyA.index + 65;
|
||||
final input = [0x1b, charCode];
|
||||
return String.fromCharCodes(input);
|
||||
|
||||
@@ -68,8 +68,7 @@ class Keytab {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (record.appCursorKeys != null &&
|
||||
record.appCursorKeys != appCursorKeys) {
|
||||
if (record.appCursorKeys != null && record.appCursorKeys != appCursorKeys) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,8 +69,7 @@ class ClickMouseHandler implements TerminalMouseHandler {
|
||||
switch (event.state.mouseMode) {
|
||||
case MouseMode.clickOnly:
|
||||
// Only clicks and only the first 3 buttons are reported.
|
||||
if (event.buttonState == TerminalMouseButtonState.down &&
|
||||
(event.button.id < 3)) {
|
||||
if (event.buttonState == TerminalMouseButtonState.down && (event.button.id < 3)) {
|
||||
return MouseReporter.report(
|
||||
event.button,
|
||||
event.buttonState,
|
||||
@@ -101,8 +100,7 @@ class UpDownMouseHandler implements TerminalMouseHandler {
|
||||
case MouseMode.upDownScrollDrag:
|
||||
case MouseMode.upDownScrollMove:
|
||||
// Up events are never reported for mouse wheel buttons.
|
||||
if (event.button.isWheel &&
|
||||
event.buttonState == TerminalMouseButtonState.up) {
|
||||
if (event.button.isWheel && event.buttonState == TerminalMouseButtonState.up) {
|
||||
return null;
|
||||
}
|
||||
return MouseReporter.report(
|
||||
|
||||
@@ -27,14 +27,9 @@ abstract class MouseReporter {
|
||||
// Normal mode only supports a maximum position of 223, while utf
|
||||
// supports positions up to 2015. Both modes send a null byte if the
|
||||
// position exceeds that limit.
|
||||
final col = (reportMode == MouseReportMode.normal && x > 223) ||
|
||||
(reportMode == MouseReportMode.utf && x > 2015)
|
||||
? '\x00'
|
||||
: String.fromCharCode(32 + x);
|
||||
final row = (reportMode == MouseReportMode.normal && y > 223) ||
|
||||
(reportMode == MouseReportMode.utf && y > 2015)
|
||||
? '\x00'
|
||||
: String.fromCharCode(32 + y + 1);
|
||||
final col = (reportMode == MouseReportMode.normal && x > 223) || (reportMode == MouseReportMode.utf && x > 2015) ? '\x00' : String.fromCharCode(32 + x);
|
||||
final row =
|
||||
(reportMode == MouseReportMode.normal && y > 223) || (reportMode == MouseReportMode.utf && y > 2015) ? '\x00' : String.fromCharCode(32 + y + 1);
|
||||
return "\x1b[M$btn$col$row";
|
||||
case MouseReportMode.sgr:
|
||||
final buttonID = button.id;
|
||||
@@ -42,8 +37,7 @@ abstract class MouseReporter {
|
||||
return "\x1b[<$buttonID;$x;$y$upDown";
|
||||
case MouseReportMode.urxvt:
|
||||
// The button ID uses the same id as to report it as in normal mode.
|
||||
final buttonID =
|
||||
32 + (state == TerminalMouseButtonState.up ? 3 : button.id);
|
||||
final buttonID = 32 + (state == TerminalMouseButtonState.up ? 3 : button.id);
|
||||
return "\x1b[$buttonID;$x;${y}M";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,7 @@ class Terminal with Observable implements TerminalState, EscapeHandler {
|
||||
void Function(String data)? onOutput;
|
||||
|
||||
/// Function that is called when the dimensions of the terminal change.
|
||||
void Function(int width, int height, int pixelWidth, int pixelHeight)?
|
||||
onResize;
|
||||
void Function(int width, int height, int pixelWidth, int pixelHeight)? onResize;
|
||||
|
||||
/// The [TerminalInputHandler] used by this terminal. [defaultInputHandler] is
|
||||
/// used when not specified. User of this class can provide their own
|
||||
|
||||
@@ -117,9 +117,7 @@ class TerminalController with ChangeNotifier {
|
||||
@internal
|
||||
bool shouldSendPointerInput(PointerInput pointerInput) {
|
||||
// Always return false if pointer input is suspended.
|
||||
return _suspendPointerInputs
|
||||
? false
|
||||
: _pointerInputs.inputs.contains(pointerInput);
|
||||
return _suspendPointerInputs ? false : _pointerInputs.inputs.contains(pointerInput);
|
||||
}
|
||||
|
||||
/// Creates a new highlight on the terminal from [p1] to [p2] with the given
|
||||
|
||||
@@ -234,8 +234,7 @@ class CustomTextEditState extends State<CustomTextEdit> with TextInputClient {
|
||||
}
|
||||
|
||||
// Reset editing state if composing is done
|
||||
if (_currentEditingState.composing.isCollapsed &&
|
||||
_currentEditingState.text != _initEditingState.text) {
|
||||
if (_currentEditingState.composing.isCollapsed && _currentEditingState.text != _initEditingState.text) {
|
||||
_connection!.setEditingState(_initEditingState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +53,7 @@ class TerminalGestureDetector extends StatefulWidget {
|
||||
final GestureDragUpdateCallback? onDragUpdate;
|
||||
|
||||
@override
|
||||
State<TerminalGestureDetector> createState() =>
|
||||
_TerminalGestureDetectorState();
|
||||
State<TerminalGestureDetector> createState() => _TerminalGestureDetectorState();
|
||||
}
|
||||
|
||||
class _TerminalGestureDetectorState extends State<TerminalGestureDetector> {
|
||||
@@ -71,8 +70,7 @@ class _TerminalGestureDetectorState extends State<TerminalGestureDetector> {
|
||||
void _handleTapDown(TapDownDetails details) {
|
||||
widget.onTapDown?.call(details);
|
||||
|
||||
if (_doubleTapTimer != null &&
|
||||
_isWithinDoubleTapTolerance(details.globalPosition)) {
|
||||
if (_doubleTapTimer != null && _isWithinDoubleTapTolerance(details.globalPosition)) {
|
||||
// If there was already a previous tap, the second down hold/tap is a
|
||||
// double tap down.
|
||||
widget.onDoubleTapDown?.call(details);
|
||||
@@ -110,8 +108,7 @@ class _TerminalGestureDetectorState extends State<TerminalGestureDetector> {
|
||||
Widget build(BuildContext context) {
|
||||
final gestures = <Type, GestureRecognizerFactory>{};
|
||||
|
||||
gestures[TapGestureRecognizer] =
|
||||
GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
|
||||
gestures[TapGestureRecognizer] = GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
|
||||
() => TapGestureRecognizer(debugOwner: this),
|
||||
(TapGestureRecognizer instance) {
|
||||
instance
|
||||
@@ -124,8 +121,7 @@ class _TerminalGestureDetectorState extends State<TerminalGestureDetector> {
|
||||
},
|
||||
);
|
||||
|
||||
gestures[LongPressGestureRecognizer] =
|
||||
GestureRecognizerFactoryWithHandlers<LongPressGestureRecognizer>(
|
||||
gestures[LongPressGestureRecognizer] = GestureRecognizerFactoryWithHandlers<LongPressGestureRecognizer>(
|
||||
() => LongPressGestureRecognizer(
|
||||
debugOwner: this,
|
||||
supportedDevices: {
|
||||
@@ -141,8 +137,7 @@ class _TerminalGestureDetectorState extends State<TerminalGestureDetector> {
|
||||
},
|
||||
);
|
||||
|
||||
gestures[PanGestureRecognizer] =
|
||||
GestureRecognizerFactoryWithHandlers<PanGestureRecognizer>(
|
||||
gestures[PanGestureRecognizer] = GestureRecognizerFactoryWithHandlers<PanGestureRecognizer>(
|
||||
() => PanGestureRecognizer(
|
||||
debugOwner: this,
|
||||
supportedDevices: <PointerDeviceKind>{PointerDeviceKind.mouse},
|
||||
|
||||
@@ -81,9 +81,7 @@ class _TerminalGestureHandlerState extends State<TerminalGestureHandler> {
|
||||
);
|
||||
}
|
||||
|
||||
bool get _shouldSendTapEvent =>
|
||||
!widget.readOnly &&
|
||||
widget.terminalController.shouldSendPointerInput(PointerInput.tap);
|
||||
bool get _shouldSendTapEvent => !widget.readOnly && widget.terminalController.shouldSendPointerInput(PointerInput.tap);
|
||||
|
||||
void _tapDown(
|
||||
GestureTapDownCallback? callback,
|
||||
@@ -179,9 +177,7 @@ class _TerminalGestureHandlerState extends State<TerminalGestureHandler> {
|
||||
void onDragStart(DragStartDetails details) {
|
||||
_lastDragStartDetails = details;
|
||||
|
||||
details.kind == PointerDeviceKind.mouse
|
||||
? renderTerminal.selectCharacters(details.localPosition)
|
||||
: renderTerminal.selectWord(details.localPosition);
|
||||
details.kind == PointerDeviceKind.mouse ? renderTerminal.selectCharacters(details.localPosition) : renderTerminal.selectWord(details.localPosition);
|
||||
}
|
||||
|
||||
void onDragUpdate(DragUpdateDetails details) {
|
||||
|
||||
@@ -20,8 +20,7 @@ class KeyboardVisibilty extends StatefulWidget {
|
||||
KeyboardVisibiltyState createState() => KeyboardVisibiltyState();
|
||||
}
|
||||
|
||||
class KeyboardVisibiltyState extends State<KeyboardVisibilty>
|
||||
with WidgetsBindingObserver {
|
||||
class KeyboardVisibiltyState extends State<KeyboardVisibilty> with WidgetsBindingObserver {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -220,8 +220,7 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
|
||||
}
|
||||
|
||||
/// Total height of the terminal in pixels. Includes scrollback buffer.
|
||||
double get _terminalHeight =>
|
||||
_terminal.buffer.lines.length * _painter.cellSize.height;
|
||||
double get _terminalHeight => _terminal.buffer.lines.length * _painter.cellSize.height;
|
||||
|
||||
/// The distance from the top of the terminal to the top of the viewport.
|
||||
// double get _scrollOffset => _offset.pixels;
|
||||
@@ -423,8 +422,7 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
|
||||
);
|
||||
}
|
||||
|
||||
if (_terminal.buffer.absoluteCursorY >= effectFirstLine &&
|
||||
_terminal.buffer.absoluteCursorY <= effectLastLine) {
|
||||
if (_terminal.buffer.absoluteCursorY >= effectFirstLine && _terminal.buffer.absoluteCursorY <= effectLastLine) {
|
||||
if (_isComposingText) {
|
||||
_paintComposingText(canvas, offset + cursorOffset);
|
||||
}
|
||||
@@ -519,9 +517,7 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
|
||||
for (var highlight in _controller.highlights) {
|
||||
final range = highlight.range?.normalized;
|
||||
|
||||
if (range == null ||
|
||||
range.begin.y > lastLine ||
|
||||
range.end.y < firstLine) {
|
||||
if (range == null || range.begin.y > lastLine || range.end.y < firstLine) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,10 @@ class TerminalScrollGestureHandler extends StatefulWidget {
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
State<TerminalScrollGestureHandler> createState() =>
|
||||
_TerminalScrollGestureHandlerState();
|
||||
State<TerminalScrollGestureHandler> createState() => _TerminalScrollGestureHandlerState();
|
||||
}
|
||||
|
||||
class _TerminalScrollGestureHandlerState
|
||||
extends State<TerminalScrollGestureHandler> {
|
||||
class _TerminalScrollGestureHandlerState extends State<TerminalScrollGestureHandler> {
|
||||
var isAltBuffer = false;
|
||||
var _lastPointerPosition = Offset.zero;
|
||||
|
||||
|
||||
@@ -18,19 +18,13 @@ Map<ShortcutActivator, Intent> get defaultTerminalShortcuts {
|
||||
}
|
||||
|
||||
final _defaultShortcuts = {
|
||||
SingleActivator(LogicalKeyboardKey.keyC, control: true, shift: true):
|
||||
CopySelectionTextIntent.copy,
|
||||
SingleActivator(LogicalKeyboardKey.keyV, control: true):
|
||||
const PasteTextIntent(SelectionChangedCause.keyboard),
|
||||
SingleActivator(LogicalKeyboardKey.keyA, control: true):
|
||||
const SelectAllTextIntent(SelectionChangedCause.keyboard),
|
||||
SingleActivator(LogicalKeyboardKey.keyC, control: true, shift: true): CopySelectionTextIntent.copy,
|
||||
SingleActivator(LogicalKeyboardKey.keyV, control: true): const PasteTextIntent(SelectionChangedCause.keyboard),
|
||||
SingleActivator(LogicalKeyboardKey.keyA, control: true): const SelectAllTextIntent(SelectionChangedCause.keyboard),
|
||||
};
|
||||
|
||||
final _defaultAppleShortcuts = {
|
||||
SingleActivator(LogicalKeyboardKey.keyC, meta: true):
|
||||
CopySelectionTextIntent.copy,
|
||||
SingleActivator(LogicalKeyboardKey.keyV, meta: true):
|
||||
const PasteTextIntent(SelectionChangedCause.keyboard),
|
||||
SingleActivator(LogicalKeyboardKey.keyA, meta: true):
|
||||
const SelectAllTextIntent(SelectionChangedCause.keyboard),
|
||||
SingleActivator(LogicalKeyboardKey.keyC, meta: true): CopySelectionTextIntent.copy,
|
||||
SingleActivator(LogicalKeyboardKey.keyV, meta: true): const PasteTextIntent(SelectionChangedCause.keyboard),
|
||||
SingleActivator(LogicalKeyboardKey.keyA, meta: true): const SelectAllTextIntent(SelectionChangedCause.keyboard),
|
||||
};
|
||||
|
||||
@@ -37,11 +37,8 @@ class TerminalStyle {
|
||||
return TerminalStyle(
|
||||
fontSize: textStyle.fontSize ?? _kDefaultFontSize,
|
||||
height: textStyle.height ?? _kDefaultHeight,
|
||||
fontFamily: textStyle.fontFamily ??
|
||||
textStyle.fontFamilyFallback?.first ??
|
||||
_kDefaultFontFamily,
|
||||
fontFamilyFallback:
|
||||
textStyle.fontFamilyFallback ?? _kDefaultFontFamilyFallback,
|
||||
fontFamily: textStyle.fontFamily ?? textStyle.fontFamilyFallback?.first ?? _kDefaultFontFamily,
|
||||
fontFamilyFallback: textStyle.fontFamilyFallback ?? _kDefaultFontFamilyFallback,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
/// A circular buffer in which elements know their index in the buffer.
|
||||
class IndexAwareCircularBuffer<T extends IndexedItem> {
|
||||
/// Creates a new circular list with the specified [maxLength].
|
||||
IndexAwareCircularBuffer(int maxLength)
|
||||
: _array = List<T?>.filled(maxLength, null);
|
||||
IndexAwareCircularBuffer(int maxLength) : _array = List<T?>.filled(maxLength, null);
|
||||
|
||||
/// The backing array for this list. Length is always equal to [maxLength].
|
||||
late List<T?> _array;
|
||||
|
||||
@@ -144,12 +144,10 @@ class _TabStrip<T> extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
: null,
|
||||
onReorderTo: (draggedId) =>
|
||||
controller.reorder(draggedId, i),
|
||||
onReorderTo: (draggedId) => controller.reorder(draggedId, i),
|
||||
tabHeight: tabHeight,
|
||||
),
|
||||
if (onAddRequested != null)
|
||||
_AddButton(onTap: onAddRequested!, tabHeight: tabHeight),
|
||||
if (onAddRequested != null) _AddButton(onTap: onAddRequested!, tabHeight: tabHeight),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -404,12 +402,9 @@ class _AddButton extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: hovered ? tokens.listItemHoverBackground : null,
|
||||
),
|
||||
child: ClideText('+',
|
||||
fontSize: clideIconStandard,
|
||||
color: hovered ? tokens.globalForeground : tokens.globalTextMuted),
|
||||
child: ClideText('+', fontSize: clideIconStandard, color: hovered ? tokens.globalForeground : tokens.globalTextMuted),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,18 +31,15 @@ void main() {
|
||||
});
|
||||
|
||||
test('rejects ../etc/passwd traversal', () {
|
||||
expect(() => resolveUnderRoot(root, '../../../etc/passwd'),
|
||||
throwsA(isA<PathOutsideRoot>()));
|
||||
expect(() => resolveUnderRoot(root, '../../../etc/passwd'), throwsA(isA<PathOutsideRoot>()));
|
||||
});
|
||||
|
||||
test('rejects traversal that lands at filesystem root', () {
|
||||
expect(() => resolveUnderRoot(root, '../'),
|
||||
throwsA(isA<PathOutsideRoot>()));
|
||||
expect(() => resolveUnderRoot(root, '../'), throwsA(isA<PathOutsideRoot>()));
|
||||
});
|
||||
|
||||
test('rejects sibling-directory traversal', () {
|
||||
expect(() => resolveUnderRoot(root, '../sibling/file'),
|
||||
throwsA(isA<PathOutsideRoot>()));
|
||||
expect(() => resolveUnderRoot(root, '../sibling/file'), throwsA(isA<PathOutsideRoot>()));
|
||||
});
|
||||
|
||||
test('allows internal `..` that stays under root', () {
|
||||
@@ -56,8 +53,7 @@ void main() {
|
||||
final twin = Directory('${root.parent.path}/${root.uri.pathSegments.where((s) => s.isNotEmpty).last}_twin');
|
||||
try {
|
||||
twin.createSync();
|
||||
expect(() => resolveUnderRoot(root, '../${twin.uri.pathSegments.where((s) => s.isNotEmpty).last}/file'),
|
||||
throwsA(isA<PathOutsideRoot>()));
|
||||
expect(() => resolveUnderRoot(root, '../${twin.uri.pathSegments.where((s) => s.isNotEmpty).last}/file'), throwsA(isA<PathOutsideRoot>()));
|
||||
} finally {
|
||||
if (twin.existsSync()) twin.deleteSync(recursive: true);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,7 @@ MultitabEntry<String> entry(String id, {bool closeable = true, bool reorderable
|
||||
);
|
||||
}
|
||||
|
||||
Widget body(BuildContext _, MultitabEntry<String> e) =>
|
||||
SizedBox(key: ValueKey('body-${e.id}'), child: Text('body:${e.payload}'));
|
||||
Widget body(BuildContext _, MultitabEntry<String> e) => SizedBox(key: ValueKey('body-${e.id}'), child: Text('body:${e.payload}'));
|
||||
|
||||
/// Stateful tap-counter body. Preserves a per-id count across rebuilds
|
||||
/// in a static map so the test can assert state survival across tab
|
||||
|
||||
Reference in New Issue
Block a user