diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 10:56:51 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-04 10:59:26 -0300 |
| commit | 5752e5c94f27eced137f4ca061c68715d8b7131a (patch) | |
| tree | ffc1785740fb008e2ebb10053a2aaaaa25b82fd6 /src/pardes.zig | |
| parent | 54f3ce0443f46f0bfe7565d6a31fb906beadf3b9 (diff) | |
| download | pardes-5752e5c94f27eced137f4ca061c68715d8b7131a.tar.gz pardes-5752e5c94f27eced137f4ca061c68715d8b7131a.zip | |
mouse: a click on a tag, a pane's, a column's or the workspace's, puts its cursor there in normal mode, where it was insert mode (the user's): a letter is a command, `i` types where it was clicked, Enter or Tab runs the word under it; the guide, the cheatsheet and the changelog say so; the tests that clicked a tag and typed now type `i` (or `a` after a sweep) first, and an Esc that left insert mode goes; snap: nine scripts likewise, layout-close's golden now the Del its chord was meant to run (the click had typed ` dk` into the tag); a behavioural test, checked to fail with insert mode back
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index b47119c4..b20fbb32 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -3081,11 +3081,15 @@ test "editable workspace and column tags are typed into and persist" { p.update(.{ .mouse = .{ .button = .left, .kind = .drag, .col = TAG_TEXT_INSET + 6, .row = 0 } }); p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = TAG_TEXT_INSET + 6, .row = 0 } }); try std.testing.expect(p.global_tag.vsel.active and p.global_tag.vsel.col == 0 and p.global_tag.cur_col == 6); - p.update(.{ .key = .{ .cp = 'H', .text = " Help" } }); + // A clicked header is in normal mode: `a` types after the sweep's + // last character, the blank it ended on. + p.update(.{ .key = .{ .cp = 'a', .text = "a" } }); + p.update(.{ .key = .{ .cp = 'H', .text = "Help " } }); try std.testing.expect(std.mem.startsWith(u8, p.global_tag.own.?, "Newcol Help Joincol")); p.update(.{ .key = .{ .cp = Key.escape } }); p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = TAG_TEXT_INSET, .row = TOPBAR_H } }); p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = TAG_TEXT_INSET, .row = TOPBAR_H } }); + p.update(.{ .key = .{ .cp = 'i', .text = "i" } }); p.update(.{ .key = .{ .cp = 'é', .text = "é" } }); try std.testing.expect(std.mem.startsWith(u8, tagline.columnTag(p, 0), "éNew")); p.update(.{ .key = .{ .cp = Key.backspace } }); @@ -3136,6 +3140,8 @@ test "column tags render edit hover and scroll from the column edge" { for (0..3) |offset| try std.testing.expectEqual(Color{ .rgb = p.theme().sel_bg }, selected.at(x + @as(u16, @intCast(offset)), TOPBAR_H).style.bg); p.update(.{ .key = .{ .cp = Key.home } }); + // A clicked header is in normal mode: `i` types there. + p.update(.{ .key = .{ .cp = 'i', .text = "i" } }); p.update(.{ .key = .{ .cp = 'H', .text = "Help " } }); try std.testing.expect(std.mem.startsWith(u8, tagline.columnTag(p, column), "Help New Tty")); const edited = try p.render(frame.allocator()); |
