diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-27 23:42:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 9584b0682b45f17aaa42157540947904d867777a (patch) | |
| tree | faac80b84c02e9611e9df9ff0e210c1d1c895a84 /src/exec.zig | |
| parent | 95a3a1bb822e583988bfe0f312d0ef219b27a454 (diff) | |
| download | pardes-9584b0682b45f17aaa42157540947904d867777a.tar.gz pardes-9584b0682b45f17aaa42157540947904d867777a.zip | |
Give prompts their own line to type into instead of the tag's tail
A search, pipe or Save prompt wrote its marker and answer onto the end of
the tag, so the tag's cursor, its selection, its 9P writes and a prompt
abandoned by a click all shared one buffer: the abandoned text stayed in
the tag and a 9P write landed inside the prompt. The answer is now its own
Text on the pane, typed in insert mode and shown on the notice band where
it was already drawn, and the tag never holds any of it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/exec.zig b/src/exec.zig index 0a9d6f31..a2dbac7c 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -219,12 +219,8 @@ pub fn withArg(p: *Pardes, txt: []const u8, arg: ?[]const u8) []const u8 { /// Enter on a save input: the path is everything past the marker. pub fn submitSave(p: *Pardes, id: usize) void { const pane = p.panes[id] orelse return; - const at = switch (pane.prompt) { - .save => |a| a, - else => return, - }; - const armed = pane.tag_tail[at..pane.tag_tail_len]; - pane.tag_tail_len = at; // drop the prompt back to the seeded tail + if (pane.prompt != .save) return; + const armed = pane.promptText() orelse return; if (!std.mem.startsWith(u8, armed, config.save_marker)) return; const path = std.mem.trim(u8, armed[config.save_marker.len..], " \t\r\n"); if (path.len == 0) return; |
