summaryrefslogtreecommitdiff
path: root/src/macos.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/macos.zig')
-rw-r--r--src/macos.zig18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/macos.zig b/src/macos.zig
index 8eb6179a..2e628d54 100644
--- a/src/macos.zig
+++ b/src/macos.zig
@@ -495,12 +495,11 @@ export fn pardes_cursor_bar() bool {
/// Perform the IO the core queued. `threads_ok` is false for the one drain
/// inside pardes_init, which runs before any reader task exists.
///
-/// ponytail: the lsp, pipe and watch effects are answered with nothing. Each
-/// wants real machinery — a worker plus a snapshot of the pane's file for lsp
+/// ponytail: the lsp, pipe and watch effects do no work here. Each wants real
+/// machinery — a worker plus a snapshot of the pane's file for lsp
/// (src/tty/tty.zig:919), a job copy for pipe, and FSEvents for watch, since
-/// inotify is Linux-only. The core is built to tolerate an unanswered effect:
-/// the browser answers none of these either. Lift tty.zig's implementations
-/// when the app is past first light.
+/// inotify is Linux-only. Lift tty.zig's implementations when the app is past
+/// first light. Pipe and watch may simply be dropped; lsp may NOT, see below.
fn drainEffects(st: *State, threads_ok: bool) bool {
const core = st.core;
var did = false;
@@ -589,7 +588,14 @@ fn drainEffects(st: *State, threads_ok: bool) bool {
const y = core.yank orelse continue;
cb(st.runtime.userdata, y.ptr, y.len);
},
- .lsp, .pipe, .watch => {},
+ // An empty answer, immediately: the honest reply from a shell with
+ // no worker, and the only safe one. Tab after a `.` DIVERTS to the
+ // backend instead of indenting and indents late, when the answer
+ // comes back empty (lspResponse); drop the effect and lsp_wait
+ // stays armed, the retroactive indent never fires, and every
+ // dot-Tab for the rest of the session does nothing at all.
+ .lsp => |q| core.update(.{ .lsp_resp = .{ .id = q.id, .rows = "" } }),
+ .pipe, .watch => {},
.quit => {},
}
}