graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
fix: delete previous word with alt backspace
justrach195d4909c008
diff --git a/scripts/eval/tier1-manifest.json b/scripts/eval/tier1-manifest.jsonindex 7549dc52..166350d6 100644--- a/scripts/eval/tier1-manifest.json+++ b/scripts/eval/tier1-manifest.json@@ -15,7 +15,7 @@"src/repl.zig","TUI/root.zig"],- "test_count_baseline": 1882,+ "test_count_baseline": 1896,"test_count_slack": 25,"required_invariants": [{diff --git a/vendor/zigzag/src/components/text_input.zig b/vendor/zigzag/src/components/text_input.zigindex 5bd0fb80..e274c284 100644--- a/vendor/zigzag/src/components/text_input.zig+++ b/vendor/zigzag/src/components/text_input.zig@@ -192,6 +192,10 @@ pub const TextInput = struct {self.moveCursorWordRight();return;},+ .backspace => {+ self.deleteWordBackward();+ return;+ },else => {},}}@@ -460,3 +464,20 @@ pub const TextInput = struct {}}};++test "alt backspace deletes the previous word" {+ const keyboard = @import("../input/keyboard.zig");+ const parsed = keyboard.parse(&.{ 0x1b, 0x7f });+ try std.testing.expectEqual(@as(usize, 2), parsed.consumed);+ try std.testing.expect(parsed.result == .key);++ var input = TextInput.init(std.testing.allocator);+ defer input.deinit();+ try input.setValue("alpha beta");+ input.cursor = input.getValue().len;++ input.handleKey(parsed.result.key);++ try std.testing.expectEqualStrings("alpha ", input.getValue());+ try std.testing.expectEqual(@as(usize, 6), input.cursor);+}