diff options
Diffstat (limited to 'src/tape.zig')
| -rw-r--r-- | src/tape.zig | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/tape.zig b/src/tape.zig index 608ad6ff..998643f2 100644 --- a/src/tape.zig +++ b/src/tape.zig @@ -136,7 +136,7 @@ pub const results = .{ ?std.Io.File.Kind, ?pardes.filesystem.Resolved, pardes.filesystem.OsReadWrite, anyerror!pardes.filesystem.OsStat, anyerror![]const u8, anyerror![]u8, - anyerror!void, terminal.Told, + anyerror!void, pardes.Term.Told, ?pardes.ctlfs.pty.Printed, @typeInfo(@TypeOf(terminal.greeting)).@"fn".return_type.?, []pardes.Stream.Batch, // What only the authority holds (`authority`): a closed pane's record, @@ -1070,6 +1070,19 @@ pub fn authorityOnly(comptime why: []const u8) bool { return true; } +/// A speculation that moves a terminal's view: a screen-state replica's +/// may (its rollback puts the view back, replica.zig `views`, and a delta +/// sets it), any other stops (`authorityOnly`). +pub fn viewOnly(comptime why: []const u8) bool { + if (!speculating()) return false; + if (screenState()) { + touchTerminal(); + return false; + } + poison(why); + return true; +} + /// A speculation read a terminal's rows or moved its view (`Tape.touched`). pub fn touchTerminal() void { if (on) |t| if (t.speculating) { |
