summaryrefslogtreecommitdiff
path: root/src/edit.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 06:08:57 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commitf923d0342f7fbbc965867c19e03cb6c94fcb7fd3 (patch)
tree5893aafa1253d4a49c61aab97fdacb9020cd8dbb /src/edit.zig
parent56274a68fb7a418625f01d479ced9fbfc19383f2 (diff)
downloadpardes-f923d0342f7fbbc965867c19e03cb6c94fcb7fd3.tar.gz
pardes-f923d0342f7fbbc965867c19e03cb6c94fcb7fd3.zip
hxlib: hxdiff's cases on the library, against helix's goldens and against the file pane (docs/next-editor.md, R6): test/hxlib.zig types each case into a `pardes-editor` value and prints its result as hxdiff prints a pane's, doing what an app does with the s, S, K and Alt-K it is handed back (the keys to <ret> its pattern, <esc> no answer) and printing a case that reaches any other action (a view, n and N, a macro, gw) as the caller's; hxdiff takes another driver's results (`--actual=`), and `zig build hxlib` (`-- --parity`) holds them to the goldens or the file pane; the key notation is test/hxkeys.zig, which both harnesses read; what the cases found, fixed: paneCursorLines gave the library's body no lines (mm, mi, ma, md, mr, insert-mode arrows), and the library's selectRegex keeps its pattern in `/` as pardes's prompt does (look.submitSearch); a page key in insert mode moves a view and is the caller's; test/lib's `zig build bench -- <KiB> <keys>`: a key's cost, the pages it changes, a parse; hxlib 537 of 658 compared with 0 mismatches (5 waived as for pardes, 121 the caller's), --parity 617 of 738 with 0 mismatches and 0 waived; hxdiff 658 / parity 738 / hxgolf 124 with 0 mismatches, core-test 811 of 950, shell-test 990 of 993, replicas pass, lib-test pass
Diffstat (limited to 'src/edit.zig')
-rw-r--r--src/edit.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/edit.zig b/src/edit.zig
index 4a48cfd4..105b9abf 100644
--- a/src/edit.zig
+++ b/src/edit.zig
@@ -378,7 +378,7 @@ pub fn exitInsert(e: Editor, t: *Text) void {
pub fn paneCursorLines(e: Editor, t: *Text) Error![]const []const u8 {
const arena = e.scratch;
- if (t.what != .body) {
+ if (t.what != .body or comptime Editor.lib) {
const text = try flatSurface(e, t);
const lines = try arena.alloc([]const u8, std.mem.count(u8, text, "\n") + 1);
var it = std.mem.splitScalar(u8, text, '\n');