diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-24 11:57:35 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-24 12:21:18 -0300 |
| commit | 8ac6db5662dd2db0f082e1651835f1db36e235f8 (patch) | |
| tree | ae8a8e928ca774b4347e4d19a8bf083c397e909b /src/gui/gui.zig | |
| parent | 51903dd947f90381d1a908c488a019289a1c8413 (diff) | |
| download | pardes-8ac6db5662dd2db0f082e1651835f1db36e235f8.tar.gz pardes-8ac6db5662dd2db0f082e1651835f1db36e235f8.zip | |
Search converge 4/6: the disk engine, Grep and Find's listing on a worker (rg when there, else a sorted walk), generation-numbered batches, a debounce, a 2000-line cap and More, and the declarations parse off the loop
Diffstat (limited to 'src/gui/gui.zig')
| -rw-r--r-- | src/gui/gui.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 5017ab53..49a98f5b 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -2202,6 +2202,8 @@ fn localSession( }; defer { if (queue.lsp_task) |*task| task.future.cancel(io); + // Its worker may be waiting on the queue for room. + core.stream.cancelTask(); queue.deinit(); } var pipe_tasks: PipeTasks = .{}; @@ -2573,6 +2575,8 @@ fn runGrid(init: std.process.Init, opts_in: pardes.Options) !void { }; defer { if (queue.lsp_task) |*task| task.future.cancel(io); + // Its worker may be waiting on the queue for room. + core.stream.cancelTask(); queue.deinit(); } var pipe_tasks: PipeTasks = .{}; @@ -3815,6 +3819,7 @@ const Shell = struct { .open_link = openLink, .lsp = lsp, .pipe = pipe, + .search = search, }; const grid_vtable: pardes.Host.VTable = vt: { @@ -3908,6 +3913,11 @@ const Shell = struct { s.saw_event = true; s.pipe_tasks.finish(s.io, response_value.id); }, + .search => |b| { + s.core.update(.{ .search = b }); + b.deinit(s.gpa); + s.saw_event = true; + }, .files_changed => check_files = true, .fs_ready => {}, }; @@ -4473,6 +4483,12 @@ fn pipe(ctx: ?*anyopaque, id: u32) void { s.core.reportError(s.core.active, "pipe", error.WorkersUnavailable); } +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); + pardes.Stream.runHere(s.core, gen); +} + fn pollCwds(core: *pardes.Pardes, ptys: *[pardes.MAX_PANES]?Pty) void { for (ptys, 0..) |slot, id| if (slot) |pt| { if (pt.fd < 0) continue; |
