diff options
Diffstat (limited to 'src/gui')
| -rw-r--r-- | src/gui/gui.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 07624c20..eb8636be 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -1744,6 +1744,7 @@ fn localSession( host_io.startWorkers(io, allocs); defer host_io.stopWorkers(); var opts = opts_in; + opts.addons = pardes.Addon.scan(); opts.image_allocator = allocs.image; opts.pdf_allocator = allocs.pdf; opts.tree_sitter_allocator = allocs.tree_sitter; @@ -1827,6 +1828,7 @@ fn localSession( .test_clock = if (test_mode) host_io.testClock() else null, .test_hz = if (std.c.getenv("PARDES_TEST_HZ")) |hz| @max(1, std.fmt.parseInt(u64, std.mem.span(hz), 10) catch 60) else 60, }; + defer shell.job_tasks.cancelAll(io); defer shell.shutdownPtys(); // A virtual clock never blinks: goldens and feel series hold still. g.no_blink = shell.test_clock != null; @@ -3172,6 +3174,7 @@ const Shell = struct { /// What drainQueue takes each wakeup, kept rather than rebuilt. batch: Queue.Batch = .{}, pipe_tasks: *PipeTasks, + job_tasks: PipeTasks = .{}, inotify_fd: c_int, watches: *file_watch.Table, threads_ok: bool = false, @@ -3545,6 +3548,7 @@ const Shell = struct { .pipe = pipe, .search = search, .hand_over = handOver, + .job = kindJob, }; /// The command panes' exits, told once their output is in (host_io). @@ -3626,6 +3630,10 @@ const Shell = struct { s.core.update(.{ .handed = .{ .seq = h.seq, .to = if (h.ok) h.words else "", .failure = if (h.ok) null else h.words } }); s.gpa.free(h.words); }, + .kind_job => |j| { + s.job_tasks.finish(s.io, j.id); + j.land(s.core); + }, .files_changed => check_files = true, .fs_ready => {}, .window => if (s.gui != null) s.openAnotherWindow(null) else s.openTheWindow(), @@ -4358,6 +4366,12 @@ fn pipe(ctx: ?*anyopaque, id: u32) void { s.core.reportError(s.core.active, "pipe", error.WorkersUnavailable); } +fn kindJob(ctx: ?*anyopaque, pane: u8, serial: u32, token: u32) void { + const s = shellOf(ctx); + if (s.threads_ok) return host_io.KindJob.start(s.io, s.core, &s.job_tasks, pane, serial, token, s.queue, Queue.pushJob); + host_io.KindJob.runHere(s.core, pane, serial, token); +} + fn search(ctx: ?*anyopaque, gen: u32) void { const s = shellOf(ctx); if (s.threads_ok) return pardes.Stream.start(s.io, s.gpa, s.core, gen, s.queue, Queue.pushSearch); |
