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/mouse.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/mouse.zig')
| -rw-r--r-- | src/mouse.zig | 4 |
1 files changed, 4 insertions, 0 deletions
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; |
