diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 11:18:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 11:23:34 -0300 |
| commit | fe4115abf7b39ff3fad4e6d0669f61a53494c753 (patch) | |
| tree | 379dae3c42905a1b5596ee54d1451c720ec951eb /src | |
| parent | 63d66e82a4ebbdf11cd12f8bc6f002075617fb94 (diff) | |
| download | pardes-fe4115abf7b39ff3fad4e6d0669f61a53494c753.tar.gz pardes-fe4115abf7b39ff3fad4e6d0669f61a53494c753.zip | |
SPC q runs Exit, refused once over unsaved panes as the tag word is, as helix's :q
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.zig | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/config.zig b/src/config.zig index 86baa9fe..e9595a2a 100644 --- a/src/config.zig +++ b/src/config.zig @@ -57,7 +57,7 @@ pub const leader_path = paths: { .Redo = null, .Repl = null, .Kill = null, - .Exit = null, + .Exit = "q", .ClipYank = "y", .ClipYankMain = "Y", .ClipPaste = "p", @@ -193,7 +193,7 @@ pub const leader_path = paths: { test "Space-k is unbound while Exit, Kill and other k chords remain available" { try std.testing.expect(leader_path.get(.Kill) == null); - try std.testing.expect(leader_path.get(.Exit) == null); + try std.testing.expectEqualStrings("q", leader_path.get(.Exit).?); try std.testing.expectEqualStrings("wk", leader_path.get(.Up).?); try std.testing.expectEqualStrings("lk", leader_path.get(.Hover).?); try std.testing.expectEqualStrings("d", leader_path.get(.Del).?); @@ -222,6 +222,21 @@ test "Space-k is unbound while Exit, Kill and other k chords remain available" { try std.testing.expect(p.quit); } +test "SPC q runs Exit: refused once over unsaved text, as the tag word is, then it quits" { + const p = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true }); + defer p.deinit(); + const pane = try p.setTestFile("text\n"); + pane.file.?.saved_revision = pane.file.?.revision -% 1; // modified + pane.file.?.saved_hash = 0; // edited: what it had is not what it has + while (p.nextEffect()) |_| {} + p.update(.{ .key = .{ .cp = ' ' } }); + p.update(.{ .key = .{ .cp = 'q' } }); + try std.testing.expect(!p.quit); + p.update(.{ .key = .{ .cp = ' ' } }); + p.update(.{ .key = .{ .cp = 'q' } }); + try std.testing.expect(p.quit); +} + pub const look_key: []const Chord = &.{.{ .cp = Key.enter }}; pub const exec_key: []const Chord = &.{.{ .cp = Key.tab }}; pub const look_button: Mouse.Button = .right; |
