summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig8
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;