From 9584b0682b45f17aaa42157540947904d867777a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 23:42:53 -0300 Subject: 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 --- src/mouse.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mouse.zig') diff --git a/src/mouse.zig b/src/mouse.zig index a840c8fc..5f77634b 100644 --- a/src/mouse.zig +++ b/src/mouse.zig @@ -304,6 +304,7 @@ pub fn handleMouse(p: *Pardes, m: Mouse) void { { if (m.button == config.select_button) if (p.panes[p.active]) |pane| { if (pane.tag_edit) Pardes.exitTagEdit(pane); + pane.closePrompt(); }; var column: ?usize = null; var x: u16 = 0; @@ -439,6 +440,7 @@ pub fn handleMouse(p: *Pardes, m: Mouse) void { const pane = p.panes[id] orelse return; if (id != p.active) if (p.panes[p.active]) |previous| { if (previous.tag_edit) Pardes.exitTagEdit(previous); + previous.closePrompt(); }; const tag_y = if (p.settings.tag_bottom) r.y + r.h -| BOX_H else r.y; const body_y = p.bodyTop(r); @@ -449,12 +451,14 @@ pub fn handleMouse(p: *Pardes, m: Mouse) void { } else if (mrow >= tag_y and mrow < tag_y + BOX_H) { if (mcol < r.x + TAG_TEXT_INSET) return; p.active = id; + pane.closePrompt(); p.enterTagEdit(pane, if (tagColumn(p, .pane, id, p.pointer_tag_hit, false)) |value| @as(i32, value) else @as(i32, mcol) - @as(i32, r.x + TAG_TEXT_INSET)); pane.tag_anchor = pane.tag_col; p.drag = .{ .tag = .{ .id = id } }; } else { p.active = id; if (pane.tag_edit) Pardes.exitTagEdit(pane); + pane.closePrompt(); const pointed = edit.pointerTextSelection(p, id, mcol, mrow, m.body_hit, p.pointer_tag_hit) orelse return; pane.clearPointerSelection(sel_slot); pane.sel[sel_slot] = pointed.sel; -- cgit v1.3