diff options
Diffstat (limited to 'core/Stream.zig')
| -rw-r--r-- | core/Stream.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/Stream.zig b/core/Stream.zig index dae61a8b..6f99b504 100644 --- a/core/Stream.zig +++ b/core/Stream.zig @@ -311,7 +311,7 @@ pub fn takeAhead(p: *Pardes, serial: u32, revision: u32, need_start: usize, need /// workers, and only for a grammar a worker can paint (syntax.readyApart). pub fn paintAhead(p: *Pardes, serial: u32, revision: u32, path: []const u8, content: []const u8, from: usize, to: usize) void { const s = &p.stream; - if (p.host.vtable.search == null or p.fs.serving or to <= from or to > content.len) return; + if (!p.tape.has(p, .search) or p.fs.serving or to <= from or to > content.len) return; const a = s.ahead_for; if (s.ahead.len != 0 and a.serial == serial and a.revision == revision and from >= a.start and to <= a.start + s.ahead.len) return; // A stretch bigger than this (a few lines of a minified file) is not @@ -355,7 +355,7 @@ pub fn askAhead(p: *Pardes) void { /// one revision of a file. pub fn paintRows(p: *Pardes, path: []const u8) void { const s = &p.stream; - if (s.rows_paint != null or p.host.vtable.search == null) return; + if (s.rows_paint != null or !p.tape.has(p, .search)) return; // Asked while a 9P write is served (a script's Grep): not now, as no // paint is (the write would wait for it to settle); the next step asks. if (p.fs.serving) { @@ -452,7 +452,7 @@ pub fn parseFor(p: *Pardes, id: usize) void { s.parse_next = .{ .serial = pane.serial, .revision = f.revision }; return; } - const workers = p.host.vtable.search != null and !p.fs.serving; + const workers = p.tape.has(p, .search) and !p.fs.serving; if (!workers and f.content.len > 64 << 10) return; const job = TextJob.make(p.gpa, pane.serial, f.revision, 0, f.path, f.content) orelse return; s.gen +%= 1; @@ -559,7 +559,7 @@ pub fn step(p: *Pardes) void { s.state = .searching; // A script's write (whose answer says whether it found anything) and a // host with no workers: done before this returns. - if (p.host.vtable.search != null and !p.fs.serving) p.emit(.{ .search = .{ .gen = s.gen } }) else runHere(p, s.gen, false); + if (p.tape.has(p, .search) and !p.fs.serving) p.emit(.{ .search = .{ .gen = s.gen } }) else runHere(p, s.gen, false); } /// When the core next needs a tick for the stream: the end of the pause. |
