Add modal input state and rails

This commit is contained in:
slhx agent
2026-06-21 12:18:13 +02:00
parent 047bae94af
commit 1468675792
4 changed files with 435 additions and 14 deletions
+8
View File
@@ -491,6 +491,7 @@ test "regular: local editor client exposes save and dirty quit guards" {
defer std.testing.allocator.free(initial);
try std.testing.expectEqualStrings("", initial);
try client.handleInput("i");
try client.handleInput("h");
try client.handleInput("e");
try client.handleInput("l");
@@ -500,12 +501,19 @@ test "regular: local editor client exposes save and dirty quit guards" {
defer std.testing.allocator.free(edited);
try std.testing.expectEqualStrings("hello", edited);
try client.handleInput(" ");
try std.testing.expectEqualStrings("insert_space", client.pendingRailName());
try client.handleInput("n");
try std.testing.expectEqualStrings("normal", client.modeName());
try client.handleInput(" ");
try client.handleInput("s");
try std.testing.expectEqualStrings("hello", try client.saved());
try client.handleInput("i");
try client.handleInput("!");
try client.handleInput(" ");
try client.handleInput("n");
try client.handleInput(" ");
try client.handleInput("q");
try std.testing.expect(client.requestedQuit());
client.clearQuit();