summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 06:22:44 -0300
committerGabriel Schneider <[email protected]>2026-10-01 07:16:43 -0300
commitfb330ce04c4eec4de317637d26310b74e2ee5923 (patch)
treeb1f9ce6f7c6814122ccd5a82f7f7812889472a16 /src/ninep
parentdf10c37122cc3e6565d13aeefb9466dc6c0dc780 (diff)
downloadpardes-fb330ce04c4eec4de317637d26310b74e2ee5923.tar.gz
pardes-fb330ce04c4eec4de317637d26310b74e2ee5923.zip
A Rename that previews other files answers its preview pane to the 9P write that asked it, and says on the message row that it previewed and applied nothing
A multi-file Rename filled a +Search preview but the waiting exec write answered the pane it was asked from, and nothing was said. lspResponse now notes the pane it filled (fs.lsp_result); the write that waited for the answer reads that pane back, as a look or an exec answers the pane it went to, and the message row says `Rename: N edit(s) across files, previewed, not applied`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index b17f150a..f0dab28d 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -4105,3 +4105,15 @@ test "Tty+bash on a pane ctl is Tty with its argument, as exec and the tag take
try testing.expectEqual(Status.ok, r.reply.status);
try testing.expect(r.spawned);
}
+
+test "a Rename that reaches other files previews them, says so, and is the pane a waiting write answers" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ const id = p.active;
+ p.fs.lsp_result = null;
+ p.lspRequest(id, .rename, "sum");
+ p.lspResponse(p.lsp_wait.?.id, "lib.rs:2:8 sum\nmain.rs:4:13-15 sum\n");
+ const preview = p.panes[p.panes[id].?.search_pane.?].?;
+ try testing.expectEqual(preview.serial, p.fs.lsp_result.?);
+ try testing.expect(th.logHas(p, "Rename: 2 edit(s) across files, previewed, not applied"));
+}