summaryrefslogtreecommitdiff
path: root/core/Stream.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Stream.zig')
-rw-r--r--core/Stream.zig15
1 files changed, 3 insertions, 12 deletions
diff --git a/core/Stream.zig b/core/Stream.zig
index 80812840..1d061b52 100644
--- a/core/Stream.zig
+++ b/core/Stream.zig
@@ -74,11 +74,9 @@ pub const Batch = struct {
/// A paint's answer (`paintAhead`): the colours of pane `serial`'s text
/// at `revision` from byte `start`, one syntax.Syn a byte.
painted: ?struct { serial: u32, revision: u32, start: usize } = null,
+ /// Or, with a `Changes` generation (jj.gen_bit), jj's annotate (jj's
+ /// log in `rows`, or its refusal and `end` failed).
styles: []u8 = &.{},
- /// A `Changes` answer (jj.zig) for pane `jj`, by serial: jj's log in
- /// `rows` and its annotate in `styles`, or its refusal in `rows` and
- /// `end` failed.
- jj: ?u32 = null,
pub const End = enum { done, failed };
@@ -259,14 +257,7 @@ rows_asked_at: u8 = 0,
/// Rows asked for their colours while a 9P write was served: asked again
/// on the next step (Query.produceAll).
rows_later: bool = false,
-/// The `Changes` asked of jj and its worker, the one asked while it ran,
-/// and how many were asked (jj.zig: one at a time, the last one pinned).
-changes: ?jj.Task = null,
-changes_next: ?*jj.Ask = null,
-changes_count: u32 = 0,
-
pub fn deinit(s: *Stream, gpa: std.mem.Allocator) void {
- jj.cancel(s);
s.cancelTask();
s.cancelParse();
s.cancelPaint();
@@ -700,8 +691,8 @@ const Collect = struct {
pub fn receive(p: *Pardes, b: *const Batch) void {
const s = &p.stream;
if (b.parsed) |parsed| return receiveParse(p, b, parsed.serial, parsed.revision);
- if (b.jj) |serial| return jj.receive(p, b, serial);
if (b.painted != null) return receivePaint(p, b);
+ if (b.gen & jj.gen_bit != 0) return jj.receive(p, b);
if (b.gen != s.gen or (s.state != .searching and s.state != .capped)) {
s.dropped += 1;
return;