diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 08:18:14 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 08:53:11 -0300 |
| commit | 920f213b3e7a3f93a4c51a5d5549da80a9b1d104 (patch) | |
| tree | 25a041881b32d7257f1d2d61fa787c632cc25ccd /src | |
| parent | 12cf44acc4edede7f20440be5ac4fd81a8c7a8c0 (diff) | |
| download | pardes-920f213b3e7a3f93a4c51a5d5549da80a9b1d104.tar.gz pardes-920f213b3e7a3f93a4c51a5d5549da80a9b1d104.zip | |
Lspinfo's exec answer is the +Lsp pane it fills: any language answer that fills a pane answers that pane, made or filled again
The answer was taken from the asking pane's search pane, which a
listing like +Lsp never sets, so Lspinfo answered the file pane. The
pane the answer filled is now known from what fillResults made or
refilled, whatever kind of listing it is.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/ninep/ctl.zig | 10 | ||||
| -rw-r--r-- | src/pardes.zig | 9 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 3b3873e3..5827a4ed 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -4294,3 +4294,13 @@ test "Find ends with what it skipped, and a Find or Grep that finds nothing leav try testing.expectEqualStrings(before, search.file.?.content); try testing.expect(th.logHas(p, "Find: name not found")); } + +test "Lspinfo's answer is the +Lsp pane it fills, as a Rename preview's is its +Search" { + const p = try withFile(testing.allocator, "x\n"); + defer p.deinit(); + p.fs.lsp_result = null; + p.lspRequest(p.active, .status, ""); + p.lspResponse(p.lsp_wait.?.id, "backend: lsp-client\n"); + const shown = p.paneBySerial(p.fs.lsp_result.?).?; + try testing.expect(std.mem.endsWith(u8, p.panes[shown].?.file.?.path, "+Lsp")); +} diff --git a/src/pardes.zig b/src/pardes.zig index b15cfb00..2b0ed8f0 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -6760,15 +6760,16 @@ pub const Pardes = struct { const dir = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice(); const content = p.gpa.dupe(u8, rows) catch return; + const serial_before = p.next_serial; + p.fs.refilled = null; panes.Output.fillResults(p, w.pane, dir, from, w.arg.slice(), content, null) catch |err| { p.reportError(w.pane, "language response", err); return; }; // What a 9P write that asked it answers: the pane the rows are in - // (a multi-file Rename's preview), not the pane it was asked from. - if (pane.search_pane) |rid| if (p.panes[rid]) |rp| { - p.fs.lsp_result = rp.serial; - }; + // (a multi-file Rename's preview, Lspinfo's +Lsp), made or filled + // again, not the pane it was asked from. + p.fs.lsp_result = if (p.next_serial != serial_before) p.next_serial else p.fs.refilled; if (w.kind == .rename) { var said_buf: [128]u8 = undefined; // Rows that only name a file the server left alone (lsp_client |
