summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.zig16
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;