summaryrefslogtreecommitdiff
path: root/core/Effect.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Effect.zig')
-rw-r--r--core/Effect.zig21
1 files changed, 13 insertions, 8 deletions
diff --git a/core/Effect.zig b/core/Effect.zig
index da6e1f7d..89a9b2e2 100644
--- a/core/Effect.zig
+++ b/core/Effect.zig
@@ -132,10 +132,14 @@ pub fn perform(p: *Pardes, e: Effect) void {
// step, would reach another pane's child.
.signal_pty => |s| if (if (p.panes[s.pane]) |pane| pane.serial != s.serial else true) {} else if (v.pty_signal) |f| f(p.host.ctx, s.pane, s.sig),
.close_pty => |c| if (v.close_pty) |f| f(p.host.ctx, c.pane),
- .open_link => |u| if (v.open_link) |f|
- f(p.host.ctx, u.slice())
- else
- p.fallback.setLink(u.slice()),
+ // The view's frontend opens it, yanks and pastes, on its own
+ // machine (View.yanks); the host here only for a view no client
+ // draws (tape.hostCall).
+ .open_link => |u| {
+ p.view().links +%= 1;
+ p.view().link = u;
+ if (v.open_link) |f| f(p.host.ctx, u.slice()) else p.fallback.setLink(u.slice());
+ },
// Plan 9's plumber's, detached (host_io.startDetached); in-process
// (a test), kept to look at.
.start => |st| {
@@ -195,15 +199,16 @@ pub fn perform(p: *Pardes, e: Effect) void {
}
},
.set_clipboard => {
+ p.view().yanks +%= 1;
const text = p.registers.text(p.gpa, '+') orelse "";
if (v.set_clipboard) |f| f(p.host.ctx, text) else p.fallback.setClipboard(text);
},
// No desktop to ask: answer from the in-process clipboard at once,
// which is the same shape as a host answering later.
- .read_clipboard => if (v.read_clipboard) |f|
- f(p.host.ctx)
- else
- p.update(.{ .paste = p.fallback.clipboard.items }),
+ .read_clipboard => {
+ p.view().pastes +%= 1;
+ if (v.read_clipboard) |f| f(p.host.ctx) else p.update(.{ .paste = p.fallback.clipboard.items });
+ },
.lsp => |q| if (v.lsp) |f|
f(p.host.ctx, .{ .id = q.id, .kind = q.kind, .pane = q.pane, .offset = q.offset, .arg = q.arg.slice() })
else