From 65bffe2c7b7fcdbd82cc112315e64e1bca8dd150 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 13:54:34 -0300 Subject: file search: / on a file pane types a pattern into the tag tail (the existing modal one-line editor — persistent, no popup); Enter runs grep -nH '' '' in a shell in the file's dir via the existing exec path (ttyForDir + write effects), so results are ordinary persistent terminal text. n/N walk the result rows of that pane (paneCursorLines already blanks prompt/echo rows via the OSC 133 semantic marks), select the row with the modal line selection, and hand path:NNN: to the existing look (actOnSelection right) which scrolls the file pane there. Esc cancels and restores the tag. State: four Pane fields (search_edit/search_at/search_pane/search_row) — no results mirror, no highlight engine. New snap script fsearch.snap + golden; all 18 frozen goldens stay green (19/19). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pardes.zig | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..88b10374 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -462,6 +462,14 @@ pub const Pane = struct { vsel: CharSel = .{}, /// one pending prefix codepoint (0 = none): `g` and `z` pending: u21 = 0, + /// `/` file search: the pattern is typed into the tag tail (no popup); + /// search_at is the tail length before " /" was appended (submit/cancel + /// restore it). n/N walk the grep results in pane search_pane, starting + /// just below search_row (the results shell's prompt row at submit). + search_edit: bool = false, + search_at: u16 = 0, + search_pane: ?usize = null, + search_row: i32 = 0, /// the editable tag tail: seeded with the default builtins on first touch; /// edited in place by a modal one-line editor sharing the pane's mode tag_tail: std.ArrayList(u8) = .empty, @@ -878,6 +886,7 @@ pub const Pardes = struct { fn exitTagEdit(pane: *Pane) void { pane.tag_edit = false; pane.tag_sel = false; + pane.search_edit = false; // an abandoned `/` input stays as tag text } fn tagSelBounds(pane: *Pane) struct { lo: usize, hi: usize } { @@ -1165,6 +1174,16 @@ pub const Pardes = struct { } else p.enterTty(p.active); return; } + // `/` search input in flight: Enter greps, Esc abandons; both restore + // the tag tail and hand focus back to the body. + if (pane.search_edit and (is(key, Key.enter) or is(key, Key.escape))) { + if (is(key, Key.enter)) p.submitSearch(pane); + pane.tag_tail.shrinkRetainingCapacity(@min(pane.search_at, pane.tag_tail.items.len)); + exitTagEdit(pane); + pane.mode = .normal; + pane.pending = 0; + return; + } // normal-mode Enter/Tab: the acme chords — look at (Enter) or execute // (Tab) the modal selection, else the file-ish word under the cursor // (on the tag tail when it's focused for editing, else the body). @@ -1522,6 +1541,95 @@ pub const Pardes = struct { if (is(key, 'y')) return p.normalYank(pane); if (is(key, 'u')) return p.doUndo(pane); if (is(key, 'U')) return p.doRedo(pane); + // file search: `/` types a pattern into the tag, n/N walk the results + if (pane.file != null and is(key, '/')) return p.startSearch(pane); + if (pane.file != null and is(key, 'n')) return p.searchStep(pane, 1); + if (pane.file != null and is(key, 'N')) return p.searchStep(pane, -1); + } + + // ---- file search (`/` + n/N): grep into a shell pane, look the results ---- + + /// `/` on a file pane: type the pattern into the tag tail after a " /" + /// marker — the existing modal one-line editor, visible while typing, + /// nothing that disappears. Enter/Esc are intercepted in handleKey. + fn startSearch(p: *Pardes, pane: *Pane) void { + if (!pane.tag_init) { + pane.tag_tail.appendSlice(p.gpa, file_pane_tail) catch return; + pane.tag_init = true; + } + pane.search_at = @intCast(pane.tag_tail.items.len); + pane.tag_tail.appendSlice(p.gpa, " /") catch return; + pane.search_edit = true; + pane.tag_edit = true; + pane.tag_sel = false; + pane.mode = .insert; + pane.pending = 0; + pane.tag_col = @intCast(pane.tag_tail.items.len); + } + + /// Enter on a `/` input: run `grep -nH '' ` in a shell in the + /// file's directory (the same path middle-click send takes), so the + /// results are ordinary persistent terminal text. Remember the results + /// pane and start n/N below its current prompt row. + fn submitSearch(p: *Pardes, pane: *Pane) void { + const f = pane.file orelse return; + const tail = pane.tag_tail.items; + const pat = std.mem.trim(u8, tail[@min(@as(usize, pane.search_at) + 2, tail.len)..], " \t\r\n"); + if (pat.len == 0) return; + const arena = p.scratch.allocator(); + var cmd: std.ArrayList(u8) = .empty; + cmd.appendSlice(arena, "grep -nH '") catch return; + for (pat) |ch| { + if (ch == '\'') cmd.appendSlice(arena, "'\\''") catch return else cmd.append(arena, ch) catch return; + } + cmd.appendSlice(arena, "' '") catch return; + cmd.appendSlice(arena, f.path) catch return; + cmd.append(arena, '\'') catch return; + const dst = p.ttyForDir(std.fs.path.dirname(f.path) orelse "/") orelse return; + const rp = p.panes[dst] orelse return; + p.padOutputBelowEdits(dst); + p.emitWrite(dst, cmd.items); + p.emitWrite(dst, "\r"); + pane.search_pane = dst; + // absolute row of the shell's cursor (the prompt echoing the grep); + // results land below it, so n scans from there — older output and + // stale results of a previous search stay behind + const sb = rp.vt.screens.active.pages.scrollbar(); + pane.search_row = @intCast(sb.total -| rp.rows + rp.vt.screens.active.cursor.y); + } + + /// n/N: select the next/previous grep result row in the results pane and + /// look it. Result rows read `path:NNN:...` and are found by their path + /// prefix; prompt/echo rows are already blanked by paneCursorLines (the + /// OSC 133 semantic row marks), so only real output is walked. + fn searchStep(p: *Pardes, pane: *Pane, delta: i32) void { + const f = pane.file orelse return; + const rid = pane.search_pane orelse return; + const rp = p.panes[rid] orelse return; + if (!rp.isTerminal()) return; + const pl = p.paneCursorLines(rp) catch return; + const nrows: i32 = @intCast(pl.lines.len); + var r = pane.search_row + delta; + while (r >= 0 and r < nrows) : (r += delta) { + const ln = pl.lines[@intCast(r)]; + if (!std.mem.startsWith(u8, ln, f.path) or ln.len <= f.path.len or ln[f.path.len] != ':') continue; + pane.search_row = r; + // select the result line in the results pane and keep it in view + rp.msel = .{ .active = true, .r0 = r, .r1 = r }; + rp.vsel.active = false; + rp.cur_row = r; + rp.cur_col = 0; + rp.cur_off = 0; + rp.cur_pinned = true; + rp.ensureCursorVisible(); + // look the leading file-ish word (path:NNN:) — the ordinary look + // path scrolls this file pane to the line + var hi: usize = 0; + while (hi < ln.len and look.isFileChar(ln[hi])) hi += 1; + p.actOnSelection(.right, rid, ln[0..hi], null); + return; + } + // no result that way (or none at all): nowhere to go, stay put } const InsertAt = enum { at, append, line_start, line_end, open_below, open_above }; -- cgit v1.3 From 5552ecb3460a8c91d12e0469ba12debe688cc6f8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 15:07:28 -0300 Subject: scrolloff: keyboard cursor moves keep 3 context rows above/below the cursor (vim scrolloff). One reconcile in Pane.ensureCursorVisible — every keyboard path (normal-mode motions, insert entry/edits, delete/yank/paste/undo/redo) already funnels through it; mouse click/wheel untouched. Clamps: line 0 at top, EOF-at-bottom-row for files (terminals let the vt clamp at the live bottom), margin shrinks on panes shorter than 2*off+1. New scrolloff.snap golden proves j-walk scroll at the margin, gg/top-row reachability, k-walk margin, G bottom clamp. 19/19 snapshots green; no existing goldens changed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pardes.zig | 15 ++- test/snapshots/scrolloff.golden | 217 ++++++++++++++++++++++++++++++++++++++++ test/snapshots/scrolloff.snap | 41 ++++++++ 3 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 test/snapshots/scrolloff.golden create mode 100644 test/snapshots/scrolloff.snap (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..eab8aa7e 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -31,6 +31,9 @@ pub const BOX_H: u16 = 1; pub const MINW: u16 = 10; pub const MINH: u16 = 3; pub const PREFIX_W: u16 = 5; +/// vim 'scrolloff': keyboard cursor moves keep this many context rows visible +/// above/below the cursor (clamped at file boundaries and short panes) +const scroll_off = 3; pub const topbar_str = "Kill Newcol Tutor Debug Colors NextColor Dump"; const pane_builtins_str = "Del"; @@ -523,9 +526,19 @@ pub const Pane = struct { } fn ensureCursorVisible(pane: *Pane) void { + // scrolloff margin, shrunk on short panes so the band stays non-empty + const margin: i32 = @min(scroll_off, @divTrunc(@as(i32, pane.rows) - 1, 2)); const off = pane.scroll(); const last = off + @as(i32, pane.rows) - 1; - if (pane.cur_row < off) pane.scrollBy(pane.cur_row - off) else if (pane.cur_row > last) pane.scrollBy(pane.cur_row - last); + if (pane.cur_row < off + margin) { + pane.scrollBy(pane.cur_row - margin - off); // scrollBy clamps at line 0 + } else if (pane.cur_row > last - margin) { + // don't scroll a file past EOF-at-bottom-row (vim's bottom clamp); + // terminals overshoot harmlessly — the vt clamps at the live bottom + var to = pane.cur_row + margin; + if (pane.file) |f| to = @min(to, @as(i32, @intCast(modal.lineCount(f.content) -| 1))); + pane.scrollBy(@max(0, to - last)); + } } /// the last navigable row: file -> last content line; terminal -> viewport bottom diff --git a/test/snapshots/scrolloff.golden b/test/snapshots/scrolloff.golden new file mode 100644 index 00000000..ed0992ad --- /dev/null +++ b/test/snapshots/scrolloff.golden @@ -0,0 +1,217 @@ +== snap top grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/scrolloff/cwd/g.txt Save Del nm /tmp/pardes-snap/scrolloff/cwd Del +| 1 line 1 +| 2 line 2 g.txt +| 3 line 3 +| 4 line 4 +| 5 line 5 +| 6 line 6 +| 7 line 7 +| 8 line 8 +| 9 line 9 +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +== snap edge grid=100x30 cursor=7,7 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/scrolloff/cwd/g.txt Save Del nm /tmp/pardes-snap/scrolloff/cwd Del +| 1 line 1 +| 2 line 2 g.txt +| 3 line 3 +| 4 line 4 +| 5 line 5 +| 6 line 6 +| 7 line 7 +| 8 line 8 +| 9 line 9 +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +== snap scrolled1 grid=100x30 cursor=7,7 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/scrolloff/cwd/g.txt Save Del nm /tmp/pardes-snap/scrolloff/cwd Del +| 2 line 2 +| 3 line 3 g.txt +| 4 line 4 +| 5 line 5 +| 6 line 6 +| 7 line 7 +| 8 line 8 +| 9 line 9 +| 10 line 10 +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +== snap jdown grid=100x30 cursor=7,7 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/scrolloff/cwd/g.txt Save Del nm /tmp/pardes-snap/scrolloff/cwd Del +| 6 line 6 +| 7 line 7 g.txt +| 8 line 8 +| 9 line 9 +| 10 line 10 +| 11 line 11 +| 12 line 12 +| 13 line 13 +| 14 line 14 +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +== snap end grid=100x30 cursor=7,10 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/scrolloff/cwd/g.txt Save Del nm /tmp/pardes-snap/scrolloff/cwd Del +| 33 line 33 +| 34 line 34 g.txt +| 35 line 35 +| 36 line 36 +| 37 line 37 +| 38 line 38 +| 39 line 39 +| 40 line 40 +| 41 +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +== snap kup grid=100x30 cursor=7,5 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/scrolloff/cwd/g.txt Save Del nm /tmp/pardes-snap/scrolloff/cwd Del +| 30 line 30 +| 31 line 31 g.txt +| 32 line 32 +| 33 line 33 +| 34 line 34 +| 35 line 35 +| 36 line 36 +| 37 line 37 +| 38 line 38 +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +== snap top2 grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/scrolloff/cwd/g.txt Save Del nm /tmp/pardes-snap/scrolloff/cwd Del +| 1 line 1 +| 2 line 2 g.txt +| 3 line 3 +| 4 line 4 +| 5 line 5 +| 6 line 6 +| 7 line 7 +| 8 line 8 +| 9 line 9 +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/scrolloff/cwd Del +| +| g.txt +| +| +| +| +| +| diff --git a/test/snapshots/scrolloff.snap b/test/snapshots/scrolloff.snap new file mode 100644 index 00000000..e231e8de --- /dev/null +++ b/test/snapshots/scrolloff.snap @@ -0,0 +1,41 @@ +# scrolloff: keyboard motion keeps 3 context rows above/below the cursor, +# clamped at file boundaries (cursor may reach the top/bottom body row there) +lines g.txt 40 +start 30 100 +wait 8000 g.txt +stable 700 20000 +# right-click the g.txt name in the greeting ls -> file pane, 9 body rows +press right 4 4 +release right 4 4 +wait 10000 line 3 +stable 700 15000 +press left 10 3 +release left 10 3 +stable 400 5000 +# (b) gg: cursor CAN sit on the top body row, no forced scroll +key g g +stable 400 5000 +snap top +# (a) five j's reach the bottom margin (visual row 5 of 9) without scrolling... +key j j j j j +stable 400 5000 +snap edge +# ...the sixth j scrolls: view slides one line, cursor holds the margin +key j +stable 400 5000 +snap scrolled1 +key j j j j +stable 400 5000 +snap jdown +# (d) G: bottom clamp, view stops at EOF-at-bottom, cursor on the bottom row +key G +stable 400 5000 +snap end +# (c) k-walk up: cursor climbs to the top margin, then the view scrolls +key k k k k k k k k +stable 400 5000 +snap kup +# (b) again from deep in the file: gg puts the cursor back on the top row +key g g +stable 400 5000 +snap top2 -- cgit v1.3 From 430914371acd3fe46c31d7be900214e7ea03f657 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 14:49:20 -0300 Subject: look on path:NN centers the target line in the pane body (scroll = line - body/2, clamped at 0): fresh opens lay out first (computeGeom after placeDoc) to center with the real body height; dedup re-looks recenter the existing pane. look-file golden shifts accordingly; new look-center snap proves fresh-open centering, dedup recentering, and the top clamp. --- src/pardes.zig | 7 ++- test/snapshots/look-center.golden | 93 +++++++++++++++++++++++++++++++++++++++ test/snapshots/look-center.snap | 28 ++++++++++++ test/snapshots/look-file.golden | 12 ++--- 4 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 test/snapshots/look-center.golden create mode 100644 test/snapshots/look-center.snap (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..5b677250 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -2631,7 +2631,7 @@ pub const Pardes = struct { if (slot) |tt| if (tt.file) |*ff| if (std.mem.eql(u8, ff.path, target.path)) { p.active = i; if (target.line > 0 and target.line <= fileLineCount(ff.content)) { - const next = target.line - 1; + const next = (target.line - 1) -| tt.rows / 2; // center, clamp at top if (next != ff.scroll) { ff.scroll = next; ff.syntax_dirty = true; @@ -2643,6 +2643,11 @@ pub const Pardes = struct { const free = p.freeSlot() orelse return; const nt = p.openFileView(free, target.path, target.line) catch return; p.placeDoc(id, free, nt); + // center the target line: the pane's real body height only + // exists after placement, so lay out now and pull the + // scroll up by half a body (line 0 opens stay at the top) + p.computeGeom(); + nt.file.?.scroll -|= @max(1, p.rects[free].h -| BOX_H) / 2; }, .image => |target| { for (p.panes, 0..) |slot, i| { diff --git a/test/snapshots/look-center.golden b/test/snapshots/look-center.golden new file mode 100644 index 00000000..f2fe15a4 --- /dev/null +++ b/test/snapshots/look-center.golden @@ -0,0 +1,93 @@ +== snap center-open grid=100x30 cursor=7,6 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/look-center/cwd/big.txt Save nm /tmp/pardes-snap/look-center/cwd Del +| 96 line 96 +| 97 line 97 big.txt +| 98 line 98 +| 99 line 99 +| 100 line 100 +| 101 line 101 +| 102 line 102 +| 103 line 103 +| 104 line 104 +| nm /tmp/pardes-snap/look-center/cwd Del +| +| big.txt +| +| +| +| big.txt:100 big.txt:150 big.txt:2 +| +| +| +| nm /tmp/pardes-snap/look-center/cwd Del +| +| big.txt +| +| +| +| +| +| +== snap center-dedup grid=100x30 cursor=4,17 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/look-center/cwd/big.txt Save nm /tmp/pardes-snap/look-center/cwd Del +| 146 line 146 +| 147 line 147 big.txt +| 148 line 148 +| 149 line 149 +| 150 line 150 +| 151 line 151 +| 152 line 152 +| 153 line 153 +| 154 line 154 +| nm /tmp/pardes-snap/look-center/cwd Del +| +| big.txt +| +| +| +| big.txt:100 big.txt:150 big.txt:2 +| +| +| +| nm /tmp/pardes-snap/look-center/cwd Del +| +| big.txt +| +| +| +| +| +| +== snap center-clamp grid=100x30 cursor=4,17 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/look-center/cwd/big.txt Save nm /tmp/pardes-snap/look-center/cwd Del +| 1 line 1 +| 2 line 2 big.txt +| 3 line 3 +| 4 line 4 +| 5 line 5 +| 6 line 6 +| 7 line 7 +| 8 line 8 +| 9 line 9 +| nm /tmp/pardes-snap/look-center/cwd Del +| +| big.txt +| +| +| +| big.txt:100 big.txt:150 big.txt:2 +| +| +| +| nm /tmp/pardes-snap/look-center/cwd Del +| +| big.txt +| +| +| +| +| +| diff --git a/test/snapshots/look-center.snap b/test/snapshots/look-center.snap new file mode 100644 index 00000000..db575844 --- /dev/null +++ b/test/snapshots/look-center.snap @@ -0,0 +1,28 @@ +# a look on path:NN opens the file with the target line CENTERED in the body +# (scroll = line - body/2): fresh open at a deep line, then dedup re-looks at +# the same path re-center the existing pane, and a look near line 1 clamps +# the scroll at 0 (no negative scroll) +lines big.txt 200 +start 30 100 +wait 8000 big.txt +stable 700 20000 +press left 5 8 +release left 5 8 +stable 400 5000 +key i +text big.txt:100 big.txt:150 big.txt:2 +key esc +settle 700 +stable 400 5000 +press right 7 8 +release right 7 8 +stable 700 15000 +snap center-open +press right 18 18 +release right 18 18 +stable 700 15000 +snap center-dedup +press right 30 18 +release right 30 18 +stable 700 15000 +snap center-clamp diff --git a/test/snapshots/look-file.golden b/test/snapshots/look-file.golden index 4f6d4a71..5e8166c7 100644 --- a/test/snapshots/look-file.golden +++ b/test/snapshots/look-file.golden @@ -1,15 +1,15 @@ -== snap file-open grid=100x30 cursor=7,2 +== snap file-open grid=100x30 cursor=7,6 |Kill Newcol Tutor Debug Colors NextColor Dump | nm /tmp/pardes-snap/look-file/cwd/big.txt Save D nm /tmp/pardes-snap/look-file/cwd Del +| 36 line 36 +| 37 line 37 big.txt +| 38 line 38 +| 39 line 39 | 40 line 40 -| 41 line 41 big.txt +| 41 line 41 | 42 line 42 | 43 line 43 | 44 line 44 -| 45 line 45 -| 46 line 46 -| 47 line 47 -| 48 line 48 | nm /tmp/pardes-snap/look-file/cwd Del | | big.txt -- cgit v1.3 From a45d29ca200341f5d41fad634c18df96605df8ab Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 14:34:07 -0300 Subject: cursor-line gutter highlight: the line number on the cursor's row takes the tag style (tag_fg/tag_bg), resolved at render time from the theme like the rest of the chrome. Same row math as the cursor pass (pinned cur_row or emulator cursor + scroll), gated on active && !tag_edit so only the focused file pane shows it. New cursorline snap script + golden proves it follows j-movement; look-file/syntax style goldens regenerated (cursor-row gutter cells only). 19/19 snap green. --- src/pardes.zig | 12 +++- test/snapshots/cursorline.golden | 124 +++++++++++++++++++++++++++++++++++++++ test/snapshots/cursorline.snap | 25 ++++++++ test/snapshots/look-file.golden | 2 +- test/snapshots/syntax.golden | 6 +- 5 files changed, 164 insertions(+), 5 deletions(-) create mode 100644 test/snapshots/cursorline.golden create mode 100644 test/snapshots/cursorline.snap (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..23c6869a 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -3288,14 +3288,24 @@ pub const Pardes = struct { // file line-number gutter: mute the first PREFIX_W columns. Cheap // chrome, not gated on colors_on; selection/cursor passes still win. + // The cursor row's number takes the tag style (same row math as the + // cursor pass below) so the eye finds the current line. if (pane.file != null) { + const goff = pane.scroll(); + const gcur = pane.vt.screens.active.cursor; + const gcrow = if (pane.cur_pinned) pane.cur_row else @as(i32, @intCast(gcur.y)) + goff; + const cur_vr: i32 = if (active and !pane.tag_edit) gcrow - goff else -1; var vr: u16 = 0; while (vr < body_h) : (vr += 1) { + const on_cursor = @as(i32, vr) == cur_vr; var c: u16 = 0; while (c < PREFIX_W and c < tw) : (c += 1) { const cell = s.at(tx + c, r.y + BOX_H + vr); cell.default = false; // paints blank gutter rows too - cell.style.fg = .{ .rgb = th.lineno }; + if (on_cursor) { + cell.style.fg = .{ .rgb = th.tag_fg }; + cell.style.bg = .{ .rgb = th.tag_bg }; + } else cell.style.fg = .{ .rgb = th.lineno }; } } } diff --git a/test/snapshots/cursorline.golden b/test/snapshots/cursorline.golden new file mode 100644 index 00000000..f50617c8 --- /dev/null +++ b/test/snapshots/cursorline.golden @@ -0,0 +1,124 @@ +== snap top grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/cursorline/cwd/cur.txt Save nm /tmp/pardes-snap/cursorline/cwd Del +| 1 line 1 +| 2 line 2 cur.txt +| 3 line 3 +| 4 line 4 +| 5 line 5 +| 6 line 6 +| 7 line 7 +| 8 line 8 +| 9 line 9 +| nm /tmp/pardes-snap/cursorline/cwd Del +| +| cur.txt +| +| +| +| cur.txt +| +| +| +| nm /tmp/pardes-snap/cursorline/cwd Del +| +| cur.txt +| +| +| +| +| +| +== style top +|0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-89 #969696,#2c2a3e, 90-99 d,#2c2a3e, +|2: 0-1 d,#525252, 2-6 #969696,#2c2a3e, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|3: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|4: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|5: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|6: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|7: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|25: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|26: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|27: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|28: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +== snap down3 grid=100x30 cursor=7,5 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/cursorline/cwd/cur.txt Save nm /tmp/pardes-snap/cursorline/cwd Del +| 1 line 1 +| 2 line 2 cur.txt +| 3 line 3 +| 4 line 4 +| 5 line 5 +| 6 line 6 +| 7 line 7 +| 8 line 8 +| 9 line 9 +| nm /tmp/pardes-snap/cursorline/cwd Del +| +| cur.txt +| +| +| +| cur.txt +| +| +| +| nm /tmp/pardes-snap/cursorline/cwd Del +| +| cur.txt +| +| +| +| +| +| +== style down3 +|0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-89 #969696,#2c2a3e, 90-99 d,#2c2a3e, +|2: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|3: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|4: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|5: 0-1 d,#2a2a2a, 2-6 #969696,#2c2a3e, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|6: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|7: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|25: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|26: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|27: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|28: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/cursorline.snap b/test/snapshots/cursorline.snap new file mode 100644 index 00000000..f9b3de5b --- /dev/null +++ b/test/snapshots/cursorline.snap @@ -0,0 +1,25 @@ +# cursor-line gutter: the line number on the cursor's row takes the tag style +# and follows modal movement (gg to the top, then jjj down three lines) +lines cur.txt 20 +start 30 100 +wait 8000 cur.txt +stable 700 20000 +press left 5 8 +release left 5 8 +stable 400 5000 +key i +text cur.txt +key esc +settle 700 +stable 400 5000 +press right 6 8 +release right 6 8 +stable 700 15000 +key g g +stable 400 5000 +snap top +snapstyle top +key j j j +stable 400 5000 +snap down3 +snapstyle down3 diff --git a/test/snapshots/look-file.golden b/test/snapshots/look-file.golden index 4f6d4a71..0b9f08cd 100644 --- a/test/snapshots/look-file.golden +++ b/test/snapshots/look-file.golden @@ -32,7 +32,7 @@ == style file-open |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, |1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-88 #969696,#2c2a3e, 89-99 d,#2c2a3e, -|2: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|2: 0-1 d,#2a2a2a, 2-6 #969696,#2c2a3e, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |5: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/syntax.golden b/test/snapshots/syntax.golden index 310d6d64..372f2999 100644 --- a/test/snapshots/syntax.golden +++ b/test/snapshots/syntax.golden @@ -32,7 +32,7 @@ == style zig-open |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, |1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, -|2: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-18 d,d, 19-25 #cc70d8,d,b 26-26 d,d, 27-31 #8ab87a,d, 32-34 d,d, 35-42 #f0f0f0,d,b 43-49 d,d, 50-51 d,#525252, 52-99 d,d, +|2: 0-1 d,#525252, 2-6 #969696,#2c2a3e, 7-18 d,d, 19-25 #cc70d8,d,b 26-26 d,d, 27-31 #8ab87a,d, 32-34 d,d, 35-42 #f0f0f0,d,b 43-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-10 d,d, 11-12 #cc70d8,d,b 13-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-23 d,d, 24-25 #d0c070,d, 26-49 d,d, 50-51 d,#525252, 52-99 d,d, |5: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -63,7 +63,7 @@ == style colors-off |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, |1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, -|2: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|2: 0-1 d,#525252, 2-6 #969696,#2c2a3e, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |5: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -94,7 +94,7 @@ == style colors-on |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, |1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, -|2: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-18 d,d, 19-25 #cc70d8,d,b 26-26 d,d, 27-31 #8ab87a,d, 32-34 d,d, 35-42 #f0f0f0,d,b 43-49 d,d, 50-51 d,#525252, 52-99 d,d, +|2: 0-1 d,#525252, 2-6 #969696,#2c2a3e, 7-18 d,d, 19-25 #cc70d8,d,b 26-26 d,d, 27-31 #8ab87a,d, 32-34 d,d, 35-42 #f0f0f0,d,b 43-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-10 d,d, 11-12 #cc70d8,d,b 13-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-23 d,d, 24-25 #d0c070,d, 26-49 d,d, 50-51 d,#525252, 52-99 d,d, |5: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -- cgit v1.3 From c1310964ac74cef1a108bd924f8d1983c3ec0e61 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 14:23:28 -0300 Subject: mode indicators: 3-char uppercase (nm→NOR, in→INS, sy→TTY). tagPrefix + dump-load tty detection (startsWith "TTY "), tutor.txt docs, exec/fileedit snap tag-click cols +1 for the wider prefix, all 18 goldens regenerated (indicator text + 1-col tag shift only) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pardes.zig | 10 +++---- src/tutor.txt | 14 +++++----- test/snapshots/boot.golden | 8 +++--- test/snapshots/dump.golden | 6 ++--- test/snapshots/edit.golden | 8 +++--- test/snapshots/exec.golden | 14 +++++----- test/snapshots/exec.snap | 4 +-- test/snapshots/fileedit.golden | 18 ++++++------- test/snapshots/fileedit.snap | 6 ++--- test/snapshots/images.golden | 24 ++++++++--------- test/snapshots/load.golden | 8 +++--- test/snapshots/look-dir.golden | 6 ++--- test/snapshots/look-file.golden | 12 ++++----- test/snapshots/modal.golden | 48 +++++++++++++++++----------------- test/snapshots/scroll.golden | 24 ++++++++--------- test/snapshots/syntax.golden | 24 ++++++++--------- test/snapshots/tag.golden | 38 +++++++++++++-------------- test/snapshots/theme.golden | 24 ++++++++--------- test/snapshots/tty.golden | 12 ++++----- test/snapshots/ttyonly.golden | 4 +-- test/snapshots/tutor.golden | 6 ++--- test/snapshots/windowops.golden | 58 ++++++++++++++++++++--------------------- 22 files changed, 188 insertions(+), 188 deletions(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..b69c8b8d 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -840,13 +840,13 @@ pub const Pardes = struct { return std.fmt.allocPrint(arena, "img {s} Petscii {s} Ascii {s}", .{ iv.path, mode, pane_builtins_str }); } if (pane.file) |f| { - const fmode = if (pane.mode == .insert) "in" else "nm"; + const fmode = if (pane.mode == .insert) "INS" else "NOR"; return std.fmt.allocPrint(arena, "{s} {s}", .{ fmode, f.path }); } const mode = switch (pane.mode) { - .normal => "nm", - .insert => "in", - .tty => "sy", + .normal => "NOR", + .insert => "INS", + .tty => "TTY", }; return std.fmt.allocPrint(arena, "{s} {s}", .{ mode, pane.cwdSlice() }); } @@ -2918,7 +2918,7 @@ pub const Pardes = struct { if (src.scroll > 0) pane.vt.screens.active.scroll(.{ .delta_row = -@as(isize, @intCast(src.scroll)) }); } p.setCwd(i, t.cwd); - if (std.mem.startsWith(u8, src.tag, "sy ")) pane.mode = .tty; + if (std.mem.startsWith(u8, src.tag, "TTY ")) pane.mode = .tty; p.restoreTail(pane, src.tag); }, .file => { diff --git a/src/tutor.txt b/src/tutor.txt index 5a93d388..94a2a20e 100644 --- a/src/tutor.txt +++ b/src/tutor.txt @@ -18,9 +18,9 @@ over. Modal editing (helix-style) is layered on top of that. Three modes (the tag shows which): - nm NORMAL block cursor, keys move/edit. DEFAULT on startup. - in INSERT keys type text at the cursor. - sy TTY keys go straight to the shell. (terminals only) + NOR NORMAL block cursor, keys move/edit. DEFAULT on startup. + INS INSERT keys type text at the cursor. + TTY TTY keys go straight to the shell. (terminals only) This tutor is in THREE parts, ordered by what's most different from editors you may know: @@ -71,7 +71,7 @@ - or select with the keyboard (`v` chars / `x` lines), then press Tab to execute or Enter to look — the acme chords on the keyboard. - THE TAG: each pane has a one-line tag: its MODE (nm/in/sy) + directory + THE TAG: each pane has a one-line tag: its MODE (NOR/INS/TTY) + directory or file path + builtins. File panes show "Save Del" by default; Save writes the current file to disk, Del closes the window. Terminal and image panes show "Del". "Delcol" still exists as a command: type it in @@ -110,11 +110,11 @@ prompt model rather than layering an editor cursor on top. On a terminal pane: - NORMAL (nm) prompt rows are HIDDEN — a clean acme-style page. You + NORMAL (NOR) prompt rows are HIDDEN — a clean acme-style page. You navigate it with the same h/j/k/l/w/b/e as a file. - INSERT (in) same clean page; keys type an insertion overlay (the + INSERT (INS) same clean page; keys type an insertion overlay (the command you're composing). Prompts still hidden. - TTY (sy) the REAL shell — prompts + typed input shown, and keys + TTY (TTY) the REAL shell — prompts + typed input shown, and keys go straight to the pty as terminal input. ESC: insert -> normal. (Esc never reaches tty.) diff --git a/test/snapshots/boot.golden b/test/snapshots/boot.golden index 85bac8dd..e17d9f3d 100644 --- a/test/snapshots/boot.golden +++ b/test/snapshots/boot.golden @@ -1,6 +1,6 @@ == snap boot grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/boot/cwd Del nm /tmp/pardes-snap/boot/cwd Del +| NOR /tmp/pardes-snap/boot/cwd Del NOR /tmp/pardes-snap/boot/cwd Del | | hello.txt hello.txt | @@ -15,7 +15,7 @@ | | | -| nm /tmp/pardes-snap/boot/cwd Del +| NOR /tmp/pardes-snap/boot/cwd Del | | hello.txt | @@ -31,7 +31,7 @@ | == style boot |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-33 #969696,#2c2a3e, 34-49 d,#2c2a3e, 50-51 d,#383c54, 52-83 #969696,#2c2a3e, 84-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#383c54, 52-84 #969696,#2c2a3e, 85-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -46,7 +46,7 @@ |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#383c54, 2-33 #969696,#2c2a3e, 34-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/dump.golden b/test/snapshots/dump.golden index c18003d5..9527f838 100644 --- a/test/snapshots/dump.golden +++ b/test/snapshots/dump.golden @@ -10,7 +10,7 @@ .panes = .{ .{ .kind = .terminal, - .tag = "nm /tmp/pardes-snap/dump/cwd Del", + .tag = "NOR /tmp/pardes-snap/dump/cwd Del", .body = "\nd.txt\n\n\n\n typed-marker\n\n\n\n\n\n\n\n", .scroll = 0, .cols = 48, @@ -27,7 +27,7 @@ }, .{ .kind = .terminal, - .tag = "nm /tmp/pardes-snap/dump/cwd Del", + .tag = "NOR /tmp/pardes-snap/dump/cwd Del", .body = "\nd.txt\n\n\n\n\n\n\n\n\n\n\n", .scroll = 0, .cols = 48, @@ -44,7 +44,7 @@ }, .{ .kind = .terminal, - .tag = "nm /tmp/pardes-snap/dump/cwd Del", + .tag = "NOR /tmp/pardes-snap/dump/cwd Del", .body = "\nd.txt\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", .scroll = 0, .cols = 48, diff --git a/test/snapshots/edit.golden b/test/snapshots/edit.golden index 846bfa30..1e253388 100644 --- a/test/snapshots/edit.golden +++ b/test/snapshots/edit.golden @@ -1,6 +1,6 @@ == snap inserted grid=100x30 cursor=4,9 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/edit/cwd Del nm /tmp/pardes-snap/edit/cwd Del +| NOR /tmp/pardes-snap/edit/cwd Del NOR /tmp/pardes-snap/edit/cwd Del | | e.txt e.txt | @@ -15,7 +15,7 @@ | | | -| nm /tmp/pardes-snap/edit/cwd Del +| NOR /tmp/pardes-snap/edit/cwd Del | | e.txt | @@ -31,7 +31,7 @@ | == style inserted |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-33 #969696,#2c2a3e, 34-49 d,#2c2a3e, 50-51 d,#383c54, 52-83 #969696,#2c2a3e, 84-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#383c54, 52-84 #969696,#2c2a3e, 85-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -46,7 +46,7 @@ |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#383c54, 2-33 #969696,#2c2a3e, 34-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/exec.golden b/test/snapshots/exec.golden index 23b1305b..01464fd9 100644 --- a/test/snapshots/exec.golden +++ b/test/snapshots/exec.golden @@ -1,6 +1,6 @@ == snap exec grid=100x30 cursor=4,7 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/exec/cwd Del nm /tmp/pardes-snap/exec/cwd Del +| NOR /tmp/pardes-snap/exec/cwd Del NOR /tmp/pardes-snap/exec/cwd Del | | e.txt e.txt | @@ -15,7 +15,7 @@ | | | -| nm /tmp/pardes-snap/exec/cwd Del +| NOR /tmp/pardes-snap/exec/cwd Del | | e.txt | @@ -31,7 +31,7 @@ | == snap kept grid=100x30 cursor=6,2 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/exec/cwd Del nm /tmp/pardes-snap/exec/cwd Del +| NOR /tmp/pardes-snap/exec/cwd Del NOR /tmp/pardes-snap/exec/cwd Del | ZZARG | ./c.sh e.txt | @@ -46,7 +46,7 @@ | | | -| nm /tmp/pardes-snap/exec/cwd Del +| NOR /tmp/pardes-snap/exec/cwd Del | | e.txt | @@ -62,7 +62,7 @@ | == snap chord grid=100x30 cursor=6,2 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/exec/cwd Del nm /tmp/pardes-snap/exec/cwd Del +| NOR /tmp/pardes-snap/exec/cwd Del NOR /tmp/pardes-snap/exec/cwd Del | ZZARG | ./c.sh e.txt | @@ -77,7 +77,7 @@ | | | -| nm /tmp/pardes-snap/exec/cwd Del +| NOR /tmp/pardes-snap/exec/cwd Del | | e.txt | @@ -93,7 +93,7 @@ | == snap deleted grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/exec/cwd Del nm /tmp/pardes-snap/exec/cwd Del +| NOR /tmp/pardes-snap/exec/cwd Del NOR /tmp/pardes-snap/exec/cwd Del | | e.txt e.txt | diff --git a/test/snapshots/exec.snap b/test/snapshots/exec.snap index dd8c24ee..a588d9f3 100644 --- a/test/snapshots/exec.snap +++ b/test/snapshots/exec.snap @@ -40,7 +40,7 @@ wait 10000 CHORDARG:ZZARG stable 700 10000 snap chord # middle-click Del in this pane's tag (after cwd prefix) closes it -press middle 32 2 -release middle 32 2 +press middle 33 2 +release middle 33 2 stable 700 10000 snap deleted diff --git a/test/snapshots/fileedit.golden b/test/snapshots/fileedit.golden index c6fb40aa..3052122e 100644 --- a/test/snapshots/fileedit.golden +++ b/test/snapshots/fileedit.golden @@ -1,6 +1,6 @@ == snap edited grid=100x30 cursor=17,2 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/fileedit/cwd/f.txt Save Del nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd/f.txt Save Del NOR /tmp/pardes-snap/fileedit/cwd Del | 1 liEDIT''MEne 1 | 2 line 2 f.txt | 3 line 3 @@ -10,7 +10,7 @@ | 7 line 7 | 8 line 8 | 9 line 9 -| nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd Del | | f.txt | @@ -20,7 +20,7 @@ | | | -| nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd Del | | f.txt | @@ -31,7 +31,7 @@ | == snap deleted grid=100x30 cursor=7,3 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/fileedit/cwd/f.txt Save Del nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd/f.txt Save Del NOR /tmp/pardes-snap/fileedit/cwd Del | 1 liEDIT''MEne 1 | 2 line 3 f.txt | 3 line 4 @@ -41,7 +41,7 @@ | 7 line 8 | 8 line 9 | 9 line 10 -| nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd Del | | f.txt | @@ -51,7 +51,7 @@ | | | -| nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd Del | | f.txt | @@ -62,7 +62,7 @@ | == snap undone grid=100x30 cursor=7,3 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/fileedit/cwd/f.txt Save Del nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd/f.txt Save Del NOR /tmp/pardes-snap/fileedit/cwd Del | 1 liEDIT''MEne 1 | 2 line 2 f.txt | 3 line 3 @@ -72,7 +72,7 @@ | 7 line 7 | 8 line 8 | 9 line 9 -| nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd Del | | f.txt | @@ -82,7 +82,7 @@ | | | -| nm /tmp/pardes-snap/fileedit/cwd Del +| NOR /tmp/pardes-snap/fileedit/cwd Del | | f.txt | diff --git a/test/snapshots/fileedit.snap b/test/snapshots/fileedit.snap index 7bafa358..bd259c8b 100644 --- a/test/snapshots/fileedit.snap +++ b/test/snapshots/fileedit.snap @@ -33,8 +33,8 @@ snap deleted key u stable 400 5000 snap undone -# Save via the tag: middle-click the Save word (after "nm ") -press middle 42 2 -release middle 42 2 +# Save via the tag: middle-click the Save word (after "NOR ") +press middle 43 2 +release middle 43 2 settle 800 snapfile saved /tmp/pardes-snap/fileedit/cwd/f.txt diff --git a/test/snapshots/images.golden b/test/snapshots/images.golden index b6e75fbf..442b084c 100644 --- a/test/snapshots/images.golden +++ b/test/snapshots/images.golden @@ -1,6 +1,6 @@ == snap img-open grid=100x30 cursor=4,7 |Kill Newcol Tutor Debug Colors NextColor Dump -| img /tmp/pardes-snap/images/cwd/pic.ppm Petscii nm /tmp/pardes-snap/images/cwd Del +| img /tmp/pardes-snap/images/cwd/pic.ppm Petscii NOR /tmp/pardes-snap/images/cwd Del | 🬝🬹 | 🬝▀█ pic.ppm | 🬝▀█ @@ -10,7 +10,7 @@ | █🬆█ | █🬆█ | 🬝🬹█ -| nm /tmp/pardes-snap/images/cwd Del +| NOR /tmp/pardes-snap/images/cwd Del | | pic.ppm | @@ -20,7 +20,7 @@ | | | -| nm /tmp/pardes-snap/images/cwd Del +| NOR /tmp/pardes-snap/images/cwd Del | | pic.ppm | @@ -31,7 +31,7 @@ | == style img-open |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-86 #969696,#2c2a3e, 87-99 d,#2c2a3e, |2: 0-1 d,#2a2a2a, 2-16 d,d, 17-32 #ffffff,#ffffff, 33-33 #ffffff,#352879, 34-34 #352879,#ffffff, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#2a2a2a, 2-16 d,d, 17-30 #ffffff,#ffffff, 31-32 #ffffff,#352879, 33-33 #352879,#ffffff, 34-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#2a2a2a, 2-16 d,d, 17-28 #ffffff,#ffffff, 29-30 #ffffff,#352879, 31-31 #352879,#ffffff, 32-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -41,7 +41,7 @@ |8: 0-1 d,#2a2a2a, 2-16 d,d, 17-20 #ffffff,#ffffff, 21-22 #ffffff,#352879, 23-23 #352879,#ffffff, 24-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |9: 0-1 d,#2a2a2a, 2-16 d,d, 17-18 #ffffff,#ffffff, 19-20 #ffffff,#352879, 21-21 #352879,#ffffff, 22-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |10: 0-1 d,#2a2a2a, 2-16 d,d, 17-17 #ffffff,#352879, 18-19 #352879,#ffffff, 20-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -51,7 +51,7 @@ |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -62,7 +62,7 @@ |29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, == style term-palette |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-86 #969696,#2c2a3e, 87-99 d,#2c2a3e, |2: 0-1 d,#2a2a2a, 2-16 d,d, 17-32 #ffffff,#ffffff, 33-33 #ffffff,#352879, 34-34 #352879,#ffffff, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#2a2a2a, 2-16 d,d, 17-30 #ffffff,#ffffff, 31-32 #ffffff,#352879, 33-33 #352879,#ffffff, 34-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#2a2a2a, 2-16 d,d, 17-28 #ffffff,#ffffff, 29-30 #ffffff,#352879, 31-31 #352879,#ffffff, 32-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -72,7 +72,7 @@ |8: 0-1 d,#2a2a2a, 2-16 d,d, 17-20 #ffffff,#ffffff, 21-22 #ffffff,#352879, 23-23 #352879,#ffffff, 24-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |9: 0-1 d,#2a2a2a, 2-16 d,d, 17-18 #ffffff,#ffffff, 19-20 #ffffff,#352879, 21-21 #352879,#ffffff, 22-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |10: 0-1 d,#2a2a2a, 2-16 d,d, 17-17 #ffffff,#352879, 18-19 #352879,#ffffff, 20-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -82,7 +82,7 @@ |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -93,7 +93,7 @@ |29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, == style no-ascii |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-86 #969696,#2c2a3e, 87-99 d,#2c2a3e, |2: 0-1 d,#2a2a2a, 2-16 d,d, 17-32 #ffffff,#ffffff, 33-33 #ffffff,#352879, 34-34 #352879,#ffffff, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#2a2a2a, 2-16 d,d, 17-30 #ffffff,#ffffff, 31-32 #ffffff,#352879, 33-33 #352879,#ffffff, 34-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#2a2a2a, 2-16 d,d, 17-28 #ffffff,#ffffff, 29-30 #ffffff,#352879, 31-31 #352879,#ffffff, 32-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -103,7 +103,7 @@ |8: 0-1 d,#2a2a2a, 2-16 d,d, 17-20 #ffffff,#ffffff, 21-22 #ffffff,#352879, 23-23 #352879,#ffffff, 24-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |9: 0-1 d,#2a2a2a, 2-16 d,d, 17-18 #ffffff,#ffffff, 19-20 #ffffff,#352879, 21-21 #352879,#ffffff, 22-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, |10: 0-1 d,#2a2a2a, 2-16 d,d, 17-17 #ffffff,#352879, 18-19 #352879,#ffffff, 20-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -113,7 +113,7 @@ |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/load.golden b/test/snapshots/load.golden index ade03fe3..5ca1bfc8 100644 --- a/test/snapshots/load.golden +++ b/test/snapshots/load.golden @@ -1,6 +1,6 @@ == snap loaded grid=100x30 cursor=4,15 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/load/cwd Del nm /tmp/pardes-snap/load/cwd Del +| NOR /tmp/pardes-snap/load/cwd Del NOR /tmp/pardes-snap/load/cwd Del | | LOADMARK d.txt | 1 @@ -15,7 +15,7 @@ | 10 | 11 | 12 -| nm /tmp/pardes-snap/load/cwd Del +| NOR /tmp/pardes-snap/load/cwd Del | | d.txt | @@ -31,7 +31,7 @@ | == style loaded |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-33 #969696,#2c2a3e, 34-49 d,#2c2a3e, 50-51 d,#383c54, 52-83 #969696,#2c2a3e, 84-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#383c54, 52-84 #969696,#2c2a3e, 85-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -46,7 +46,7 @@ |13: 0-1 d,#2a2a2a, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#2a2a2a, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#2a2a2a, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#383c54, 2-33 #969696,#2c2a3e, 34-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/look-dir.golden b/test/snapshots/look-dir.golden index c4337878..ccd6b9e9 100644 --- a/test/snapshots/look-dir.golden +++ b/test/snapshots/look-dir.golden @@ -1,10 +1,10 @@ == snap dir-open grid=100x30 cursor=4,8 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/look-dir/cwd Del nm /tmp/pardes-snap/look-dir/cwd Del +| NOR /tmp/pardes-snap/look-dir/cwd Del NOR /tmp/pardes-snap/look-dir/cwd Del | | sub top.txt sub top.txt | -| nm /tmp/pardes-snap/look-dir/cwd/sub Del +| NOR /tmp/pardes-snap/look-dir/cwd/sub Del | | inner.txt | @@ -15,7 +15,7 @@ | | | -| nm /tmp/pardes-snap/look-dir/cwd Del +| NOR /tmp/pardes-snap/look-dir/cwd Del | | sub top.txt | diff --git a/test/snapshots/look-file.golden b/test/snapshots/look-file.golden index 4f6d4a71..162d9a6f 100644 --- a/test/snapshots/look-file.golden +++ b/test/snapshots/look-file.golden @@ -1,6 +1,6 @@ == snap file-open grid=100x30 cursor=7,2 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/look-file/cwd/big.txt Save D nm /tmp/pardes-snap/look-file/cwd Del +| NOR /tmp/pardes-snap/look-file/cwd/big.txt Save NOR /tmp/pardes-snap/look-file/cwd Del | 40 line 40 | 41 line 41 big.txt | 42 line 42 @@ -10,7 +10,7 @@ | 46 line 46 | 47 line 47 | 48 line 48 -| nm /tmp/pardes-snap/look-file/cwd Del +| NOR /tmp/pardes-snap/look-file/cwd Del | | big.txt | @@ -20,7 +20,7 @@ | | | -| nm /tmp/pardes-snap/look-file/cwd Del +| NOR /tmp/pardes-snap/look-file/cwd Del | | big.txt | @@ -31,7 +31,7 @@ | == style file-open |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-88 #969696,#2c2a3e, 89-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-89 #969696,#2c2a3e, 90-99 d,#2c2a3e, |2: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -41,7 +41,7 @@ |8: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |9: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |10: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -51,7 +51,7 @@ |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/modal.golden b/test/snapshots/modal.golden index b4922f12..668fd02c 100644 --- a/test/snapshots/modal.golden +++ b/test/snapshots/modal.golden @@ -1,6 +1,6 @@ == snap top grid=100x30 cursor=2,2 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -15,7 +15,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -31,7 +31,7 @@ | == snap moved grid=100x30 cursor=2,6 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -46,7 +46,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -62,7 +62,7 @@ | == snap xsel grid=100x30 cursor=2,6 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -77,7 +77,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -93,7 +93,7 @@ | == style xsel |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#383c54, 52-84 #969696,#2c2a3e, 85-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -108,7 +108,7 @@ |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#383c54, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -124,7 +124,7 @@ |29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, == snap xsel2 grid=100x30 cursor=2,7 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -139,7 +139,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -155,7 +155,7 @@ | == snap yanked grid=100x30 cursor=2,6 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -170,7 +170,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -186,7 +186,7 @@ | == snap vsel grid=100x30 cursor=3,7 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -201,7 +201,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -217,7 +217,7 @@ | == style vsel |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#383c54, 52-84 #969696,#2c2a3e, 85-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -232,7 +232,7 @@ |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#383c54, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -248,7 +248,7 @@ |29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, == snap typed grid=100x30 cursor=3,7 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -263,7 +263,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -279,7 +279,7 @@ | == snap undone grid=100x30 cursor=3,7 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -294,7 +294,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -310,7 +310,7 @@ | == snap redone grid=100x30 cursor=3,7 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -325,7 +325,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | @@ -341,7 +341,7 @@ | == snap bottom grid=100x30 cursor=2,9 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/modal/cwd Del nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del NOR /tmp/pardes-snap/modal/cwd Del | | words.txt words.txt | @@ -356,7 +356,7 @@ | | | -| nm /tmp/pardes-snap/modal/cwd Del +| NOR /tmp/pardes-snap/modal/cwd Del | | words.txt | diff --git a/test/snapshots/scroll.golden b/test/snapshots/scroll.golden index 899c7dec..971f9659 100644 --- a/test/snapshots/scroll.golden +++ b/test/snapshots/scroll.golden @@ -1,6 +1,6 @@ == snap bottom grid=100x30 cursor=4,15 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/scroll/cwd Del nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del NOR /tmp/pardes-snap/scroll/cwd Del | 188 | 189 s.txt | 190 @@ -15,7 +15,7 @@ | 199 | 200 | -| nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del | | s.txt | @@ -31,7 +31,7 @@ | == snap wheel3 grid=100x30 cursor=4,15 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/scroll/cwd Del nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del NOR /tmp/pardes-snap/scroll/cwd Del | 185 | 186 s.txt | 187 @@ -46,7 +46,7 @@ | 196 | 197 | 198 -| nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del | | s.txt | @@ -62,7 +62,7 @@ | == snap gutter-up grid=100x30 cursor=4,15 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/scroll/cwd Del nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del NOR /tmp/pardes-snap/scroll/cwd Del | 178 | 179 s.txt | 180 @@ -77,7 +77,7 @@ | 189 | 190 | 191 -| nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del | | s.txt | @@ -93,7 +93,7 @@ | == snap gutter-down grid=100x30 cursor=4,15 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/scroll/cwd Del nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del NOR /tmp/pardes-snap/scroll/cwd Del | 180 | 181 s.txt | 182 @@ -108,7 +108,7 @@ | 191 | 192 | 193 -| nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del | | s.txt | @@ -124,7 +124,7 @@ | == snap wheel-down grid=100x30 cursor=4,15 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/scroll/cwd Del nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del NOR /tmp/pardes-snap/scroll/cwd Del | 181 | 182 s.txt | 183 @@ -139,7 +139,7 @@ | 192 | 193 | 194 -| nm /tmp/pardes-snap/scroll/cwd Del +| NOR /tmp/pardes-snap/scroll/cwd Del | | s.txt | @@ -155,7 +155,7 @@ | == style wheel-down |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#383c54, 52-86 #969696,#2c2a3e, 87-99 d,#2c2a3e, |2: 0-1 d,#2a2a2a, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#2a2a2a, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#2a2a2a, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -170,7 +170,7 @@ |13: 0-1 d,#2a2a2a, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#2a2a2a, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/syntax.golden b/test/snapshots/syntax.golden index 310d6d64..a63d9c23 100644 --- a/test/snapshots/syntax.golden +++ b/test/snapshots/syntax.golden @@ -1,6 +1,6 @@ == snap zig-open grid=100x30 cursor=7,2 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/syntax/cwd/demo.zig Save Del nm /tmp/pardes-snap/syntax/cwd Del +| NOR /tmp/pardes-snap/syntax/cwd/demo.zig Save De NOR /tmp/pardes-snap/syntax/cwd Del | 1 const std = @import("std"); // greet | 2 pub fn main() void { demo.zig | 3 var x: u32 = 42; @@ -10,7 +10,7 @@ | | | -| nm /tmp/pardes-snap/syntax/cwd Del +| NOR /tmp/pardes-snap/syntax/cwd Del | | demo.zig | @@ -20,7 +20,7 @@ | | | -| nm /tmp/pardes-snap/syntax/cwd Del +| NOR /tmp/pardes-snap/syntax/cwd Del | | demo.zig | @@ -31,7 +31,7 @@ | == style zig-open |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-86 #969696,#2c2a3e, 87-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-18 d,d, 19-25 #cc70d8,d,b 26-26 d,d, 27-31 #8ab87a,d, 32-34 d,d, 35-42 #f0f0f0,d,b 43-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-10 d,d, 11-12 #cc70d8,d,b 13-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-23 d,d, 24-25 #d0c070,d, 26-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -41,7 +41,7 @@ |8: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |9: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |10: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -51,7 +51,7 @@ |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -62,7 +62,7 @@ |29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, == style colors-off |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-86 #969696,#2c2a3e, 87-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -72,7 +72,7 @@ |8: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |9: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |10: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -82,7 +82,7 @@ |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -93,7 +93,7 @@ |29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, == style colors-on |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-86 #969696,#2c2a3e, 87-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-18 d,d, 19-25 #cc70d8,d,b 26-26 d,d, 27-31 #8ab87a,d, 32-34 d,d, 35-42 #f0f0f0,d,b 43-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-10 d,d, 11-12 #cc70d8,d,b 13-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-23 d,d, 24-25 #d0c070,d, 26-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -103,7 +103,7 @@ |8: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |9: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |10: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -113,7 +113,7 @@ |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/tag.golden b/test/snapshots/tag.golden index 9275777b..9632ab6a 100644 --- a/test/snapshots/tag.golden +++ b/test/snapshots/tag.golden @@ -1,6 +1,6 @@ -== snap tag-focus grid=100x30 cursor=33,1 +== snap tag-focus grid=100x30 cursor=34,1 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/tag/cwd Del nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del NOR /tmp/pardes-snap/tag/cwd Del | | t.txt t.txt | @@ -15,7 +15,7 @@ | | | -| nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del | | t.txt | @@ -29,9 +29,9 @@ | | | -== snap tag-typed grid=100x30 cursor=46,1 +== snap tag-typed grid=100x30 cursor=47,1 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/tag/cwd Del echo TAG''OK nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del echo TAG''OK NOR /tmp/pardes-snap/tag/cwd Del | | t.txt t.txt | @@ -46,7 +46,7 @@ | | | -| nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del | | t.txt | @@ -60,9 +60,9 @@ | | | -== snap tag-exec grid=100x30 cursor=45,1 +== snap tag-exec grid=100x30 cursor=46,1 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/tag/cwd Del echo TAG''OK nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del echo TAG''OK NOR /tmp/pardes-snap/tag/cwd Del | | t.txt t.txt | @@ -77,7 +77,7 @@ | | | -| nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del | | t.txt | @@ -91,9 +91,9 @@ | | | -== snap tag-vsel grid=100x30 cursor=31,1 +== snap tag-vsel grid=100x30 cursor=32,1 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/tag/cwd Del echo TAG''OK nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del echo TAG''OK NOR /tmp/pardes-snap/tag/cwd Del | | t.txt t.txt | @@ -108,7 +108,7 @@ | | | -| nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del | | t.txt | @@ -124,7 +124,7 @@ | == style tag-vsel |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-28 #969696,#2c2a3e, 29-31 #d8c8a8,#4a3a1e, 32-45 #969696,#2c2a3e, 46-49 d,#2c2a3e, 50-51 d,#383c54, 52-82 #969696,#2c2a3e, 83-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-29 #969696,#2c2a3e, 30-32 #d8c8a8,#4a3a1e, 33-46 #969696,#2c2a3e, 47-49 d,#2c2a3e, 50-51 d,#383c54, 52-83 #969696,#2c2a3e, 84-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -139,7 +139,7 @@ |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#383c54, 2-32 #969696,#2c2a3e, 33-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-33 #969696,#2c2a3e, 34-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -153,9 +153,9 @@ |27: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |28: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |29: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -== snap tag-del grid=100x30 cursor=29,1 +== snap tag-del grid=100x30 cursor=30,1 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/tag/cwdl echo TAG''OK nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwdl echo TAG''OK NOR /tmp/pardes-snap/tag/cwd Del | | t.txt t.txt | @@ -170,7 +170,7 @@ | | | -| nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del | | t.txt | @@ -186,7 +186,7 @@ | == snap tag-exit grid=100x30 cursor=4,6 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/tag/cwdl echo TAG''OK nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwdl echo TAG''OK NOR /tmp/pardes-snap/tag/cwd Del | | t.txt t.txt | @@ -201,7 +201,7 @@ | | | -| nm /tmp/pardes-snap/tag/cwd Del +| NOR /tmp/pardes-snap/tag/cwd Del | | t.txt | diff --git a/test/snapshots/theme.golden b/test/snapshots/theme.golden index b90e0011..5435eee4 100644 --- a/test/snapshots/theme.golden +++ b/test/snapshots/theme.golden @@ -1,6 +1,6 @@ == snap acme grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/theme/cwd Del nm /tmp/pardes-snap/theme/cwd Del +| NOR /tmp/pardes-snap/theme/cwd Del NOR /tmp/pardes-snap/theme/cwd Del | | t.txt t.txt | @@ -15,7 +15,7 @@ | | | -| nm /tmp/pardes-snap/theme/cwd Del +| NOR /tmp/pardes-snap/theme/cwd Del | | t.txt | @@ -31,7 +31,7 @@ | == style acme |0: 0-44 #000000,#eaffff, 45-99 d,#eaffff, -|1: 0-1 d,#6e4fd0, 2-34 #000000,#eaffff, 35-49 d,#eaffff, 50-51 d,#383c54, 52-84 #000000,#eaffff, 85-99 d,#eaffff, +|1: 0-1 d,#6e4fd0, 2-35 #000000,#eaffff, 36-49 d,#eaffff, 50-51 d,#383c54, 52-85 #000000,#eaffff, 86-99 d,#eaffff, |2: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, |3: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, |4: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, @@ -46,7 +46,7 @@ |13: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, |14: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, |15: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, -|16: 0-1 d,#383c54, 2-34 #000000,#eaffff, 35-49 d,#eaffff, 50-51 d,#ffffea, 52-99 #000000,#ffffea, +|16: 0-1 d,#383c54, 2-35 #000000,#eaffff, 36-49 d,#eaffff, 50-51 d,#ffffea, 52-99 #000000,#ffffea, |17: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, |18: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, |19: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, @@ -62,7 +62,7 @@ |29: 0-1 d,#ffffea, 2-49 #000000,#ffffea, 50-51 d,#ffffea, 52-99 #000000,#ffffea, == snap colors-off grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/theme/cwd Del nm /tmp/pardes-snap/theme/cwd Del +| NOR /tmp/pardes-snap/theme/cwd Del NOR /tmp/pardes-snap/theme/cwd Del | | t.txt t.txt | @@ -77,7 +77,7 @@ | | | -| nm /tmp/pardes-snap/theme/cwd Del +| NOR /tmp/pardes-snap/theme/cwd Del | | t.txt | @@ -93,7 +93,7 @@ | == style colors-off |0: 0-44 #000000,#eaffff, 45-99 d,#eaffff, -|1: 0-1 d,#6e4fd0, 2-34 #000000,#eaffff, 35-49 d,#eaffff, 50-51 d,#383c54, 52-84 #000000,#eaffff, 85-99 d,#eaffff, +|1: 0-1 d,#6e4fd0, 2-35 #000000,#eaffff, 36-49 d,#eaffff, 50-51 d,#383c54, 52-85 #000000,#eaffff, 86-99 d,#eaffff, |2: 0-99 d,#ffffea, |3: 0-1 d,#ffffea, 2-6 #000000,#ffffea, 7-51 d,#ffffea, 52-56 #000000,#ffffea, 57-99 d,#ffffea, |4: 0-99 d,#ffffea, @@ -108,7 +108,7 @@ |13: 0-99 d,#ffffea, |14: 0-99 d,#ffffea, |15: 0-99 d,#ffffea, -|16: 0-1 d,#383c54, 2-34 #000000,#eaffff, 35-49 d,#eaffff, 50-99 d,#ffffea, +|16: 0-1 d,#383c54, 2-35 #000000,#eaffff, 36-49 d,#eaffff, 50-99 d,#ffffea, |17: 0-99 d,#ffffea, |18: 0-1 d,#ffffea, 2-6 #000000,#ffffea, 7-99 d,#ffffea, |19: 0-99 d,#ffffea, @@ -124,7 +124,7 @@ |29: 0-99 d,#ffffea, == snap dark-again grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/theme/cwd Del nm /tmp/pardes-snap/theme/cwd Del +| NOR /tmp/pardes-snap/theme/cwd Del NOR /tmp/pardes-snap/theme/cwd Del | | t.txt t.txt | @@ -139,7 +139,7 @@ | | | -| nm /tmp/pardes-snap/theme/cwd Del +| NOR /tmp/pardes-snap/theme/cwd Del | | t.txt | @@ -155,7 +155,7 @@ | == style dark-again |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#383c54, 52-84 #969696,#2c2a3e, 85-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -170,7 +170,7 @@ |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#383c54, 2-34 #969696,#2c2a3e, 35-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/tty.golden b/test/snapshots/tty.golden index 7e6bebc5..63e4a760 100644 --- a/test/snapshots/tty.golden +++ b/test/snapshots/tty.golden @@ -1,6 +1,6 @@ == snap tty-on grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| sy /tmp/pardes-snap/tty/cwd Del nm /tmp/pardes-snap/tty/cwd Del +| TTY /tmp/pardes-snap/tty/cwd Del NOR /tmp/pardes-snap/tty/cwd Del | $ ls | m.txt m.txt | $ @@ -15,7 +15,7 @@ | | | -| nm /tmp/pardes-snap/tty/cwd Del +| NOR /tmp/pardes-snap/tty/cwd Del | | m.txt | @@ -31,7 +31,7 @@ | == snap tty-echo grid=100x30 cursor=4,6 |Kill Newcol Tutor Debug Colors NextColor Dump -| sy /tmp/pardes-snap/tty/cwd Del nm /tmp/pardes-snap/tty/cwd Del +| TTY /tmp/pardes-snap/tty/cwd Del NOR /tmp/pardes-snap/tty/cwd Del | $ ls | m.txt m.txt | $ echo SNAP''OK @@ -46,7 +46,7 @@ | | | -| nm /tmp/pardes-snap/tty/cwd Del +| NOR /tmp/pardes-snap/tty/cwd Del | | m.txt | @@ -62,7 +62,7 @@ | == snap tty-off grid=100x30 cursor=4,6 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/tty/cwd Del nm /tmp/pardes-snap/tty/cwd Del +| NOR /tmp/pardes-snap/tty/cwd Del NOR /tmp/pardes-snap/tty/cwd Del | | m.txt m.txt | @@ -77,7 +77,7 @@ | | | -| nm /tmp/pardes-snap/tty/cwd Del +| NOR /tmp/pardes-snap/tty/cwd Del | | m.txt | diff --git a/test/snapshots/ttyonly.golden b/test/snapshots/ttyonly.golden index 20ddf792..f8722061 100644 --- a/test/snapshots/ttyonly.golden +++ b/test/snapshots/ttyonly.golden @@ -1,6 +1,6 @@ == snap ttyonly grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| sy /tmp/pardes-snap/ttyonly/cwd Del +| TTY /tmp/pardes-snap/ttyonly/cwd Del | $ echo TTY''ONLY | TTYONLY | $ @@ -31,7 +31,7 @@ | == style ttyonly |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#6e4fd0, 2-36 #969696,#2c2a3e, 37-99 d,#2c2a3e, +|1: 0-1 d,#6e4fd0, 2-37 #969696,#2c2a3e, 38-99 d,#2c2a3e, |2: 0-1 d,#525252, 2-99 d,d, |3: 0-1 d,#525252, 2-99 d,d, |4: 0-1 d,#525252, 2-99 d,d, diff --git a/test/snapshots/tutor.golden b/test/snapshots/tutor.golden index 55d66c9b..65309811 100644 --- a/test/snapshots/tutor.golden +++ b/test/snapshots/tutor.golden @@ -1,6 +1,6 @@ == snap tutor grid=100x30 cursor=7,2 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /Tutor Save Del nm /tmp/pardes-snap/tutor/cwd Del +| NOR /Tutor Save Del NOR /tmp/pardes-snap/tutor/cwd Del | 1 | 2 PARDES TUTOR | 3 tmux + vi + acme, from @@ -10,7 +10,7 @@ | 7 Press j until you reach the introdu | 8 | 9 -| nm /tmp/pardes-snap/tutor/cwd Del +| NOR /tmp/pardes-snap/tutor/cwd Del | | | @@ -20,7 +20,7 @@ | | | -| nm /tmp/pardes-snap/tutor/cwd Del +| NOR /tmp/pardes-snap/tutor/cwd Del | | | diff --git a/test/snapshots/windowops.golden b/test/snapshots/windowops.golden index 061ceca9..fae9e55b 100644 --- a/test/snapshots/windowops.golden +++ b/test/snapshots/windowops.golden @@ -1,6 +1,6 @@ == snap hover-v grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del ╎ nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del ╎ NOR /tmp/pardes-snap/windowops/cwd Del | ╎ | w.txt ╎ w.txt | ╎ @@ -15,7 +15,7 @@ | ╎ | ╎ | ╎ -| nm /tmp/pardes-snap/windowops/cwd Del ╎ +| NOR /tmp/pardes-snap/windowops/cwd Del ╎ | ╎ | w.txt ╎ | ╎ @@ -31,7 +31,7 @@ | ╎ == snap hover-h grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt w.txt | @@ -46,7 +46,7 @@ | | |╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -62,7 +62,7 @@ | == snap border-drag grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del╎ nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd De╎ NOR /tmp/pardes-snap/windowops/cwd Del | ╎ | w.txt ╎ w.txt | ╎ @@ -77,7 +77,7 @@ | ╎ | ╎ | ╎ -| nm /tmp/pardes-snap/windowops/cwd Del╎ +| NOR /tmp/pardes-snap/windowops/cwd De╎ | ╎ | w.txt ╎ | ╎ @@ -93,7 +93,7 @@ | ╎ == snap border-done grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del╎ nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd De╎ NOR /tmp/pardes-snap/windowops/cwd Del | ╎ | w.txt ╎ w.txt | ╎ @@ -108,7 +108,7 @@ | ╎ | ╎ | ╎ -| nm /tmp/pardes-snap/windowops/cwd Del╎ +| NOR /tmp/pardes-snap/windowops/cwd De╎ | ╎ | w.txt ╎ | ╎ @@ -124,7 +124,7 @@ | ╎ == snap hborder-done grid=100x30 cursor=4,4 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt w.txt | @@ -135,7 +135,7 @@ | | |╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -155,7 +155,7 @@ | == snap move-preview grid=100x30 cursor=4,15 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt w.txt | @@ -166,7 +166,7 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -186,7 +186,7 @@ | == snap moved grid=100x30 cursor=4,15 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt w.txt | @@ -197,7 +197,7 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -217,14 +217,14 @@ | == snap altn grid=100x30 cursor=4,23 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt w.txt | | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -236,7 +236,7 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -248,14 +248,14 @@ | == snap focus-left grid=100x30 cursor=4,23 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt w.txt | | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -267,7 +267,7 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -279,14 +279,14 @@ | == snap debug-on grid=100x30 cursor=4,23 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowop╭────────────────────────────╮ +| NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowo╭────────────────────────────╮ | │pardes resizes=1 │ | w.txt w.txt │terms 4 cols 2 │ | │active #3 38x9 │ | │scroll 0/9 │ | │pinch 1.0000 │ | │tscroll 0.0000 │ -| nm /tmp/pardes-snap/windowops/cwd Del ╰────────────────────────────╯ +| NOR /tmp/pardes-snap/windowops/cwd Del ╰────────────────────────────╯ | | w.txt | @@ -298,7 +298,7 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -310,14 +310,14 @@ | == style debug-on |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, -|1: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-39 d,#2c2a3e, 40-41 d,#383c54, 42-69 #969696,#2c2a3e, 70-99 d,d, +|1: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-41 d,#383c54, 42-69 #969696,#2c2a3e, 70-99 d,d, |2: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-87 #969696,d, 88-98 d,#2a2a2a, 99-99 d,d, |3: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-85 #969696,d, 86-98 d,#2a2a2a, 99-99 d,d, |4: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-85 #969696,d, 86-98 d,#2a2a2a, 99-99 d,d, |5: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-80 #969696,d, 81-98 d,#2a2a2a, 99-99 d,d, |6: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-83 #969696,d, 84-98 d,#2a2a2a, 99-99 d,d, |7: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-85 #969696,d, 86-98 d,#2a2a2a, 99-99 d,d, -|8: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-39 d,#2c2a3e, 40-41 d,#525252, 42-99 d,d, +|8: 0-1 d,#383c54, 2-39 #969696,#2c2a3e, 40-41 d,#525252, 42-99 d,d, |9: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |10: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |11: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, @@ -329,7 +329,7 @@ |17: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |18: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |19: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, -|20: 0-1 d,#6e4fd0, 2-38 #969696,#2c2a3e, 39-39 d,#2c2a3e, 40-41 d,#525252, 42-99 d,d, +|20: 0-1 d,#6e4fd0, 2-39 #969696,#2c2a3e, 40-41 d,#525252, 42-99 d,d, |21: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |22: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |23: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, @@ -341,14 +341,14 @@ |29: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, == snap debug-off grid=100x30 cursor=4,23 |Kill Newcol Tutor Debug Colors NextColor Dump -| nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt w.txt | | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | @@ -360,7 +360,7 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del +| NOR /tmp/pardes-snap/windowops/cwd Del | | w.txt | -- cgit v1.3 From ffa636a284b3ccc9aa4f31dff7f148780d2cd00b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 17:36:07 -0300 Subject: tty look motion: n/N on a terminal pane (normal mode only) walk the pane's own output rows — paneCursorLines, prompt/echo rows already blanked by the OSC 133 marks — for the next/prev row whose leading file-ish word resolves through look.resolve (realpath-only, side-effect-free; only the chosen row gets the real look), msel-select it, scroll it into view, and look it via actOnSelection. The modal cursor is the position (no new Pane state), so the walk resumes wherever j/k left it; focus returns to the terminal after the look so n keeps stepping; no wrap; no hit = no-op. Insert mode still splices, tty mode still forwards to the pty. The file-pane search stepper stays separate (different row predicate: the searched file's path prefix vs general resolvability). New snap script ttylook.snap + golden; all 19 baseline goldens untouched and green (20/20). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pardes.zig | 34 +++++ test/snapshots/ttylook.golden | 279 ++++++++++++++++++++++++++++++++++++++++++ test/snapshots/ttylook.snap | 77 ++++++++++++ 3 files changed, 390 insertions(+) create mode 100644 test/snapshots/ttylook.golden create mode 100644 test/snapshots/ttylook.snap (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 88b10374..ac543aeb 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1545,6 +1545,9 @@ pub const Pardes = struct { if (pane.file != null and is(key, '/')) return p.startSearch(pane); if (pane.file != null and is(key, 'n')) return p.searchStep(pane, 1); if (pane.file != null and is(key, 'N')) return p.searchStep(pane, -1); + // terminal n/N: look the next/previous output row that looks somewhere + if (pane.isTerminal() and is(key, 'n')) return p.lookStep(pane, pl, 1); + if (pane.isTerminal() and is(key, 'N')) return p.lookStep(pane, pl, -1); } // ---- file search (`/` + n/N): grep into a shell pane, look the results ---- @@ -1632,6 +1635,37 @@ pub const Pardes = struct { // no result that way (or none at all): nowhere to go, stay put } + /// n/N on a terminal pane (normal mode): select the next/previous output + /// row whose leading file-ish word looks somewhere — resolves to a + /// file/dir/path:NNN exactly as a right click would — and look it. The + /// scan only resolves (realpath, no pane opens, no scrolls); the one + /// chosen row gets the real look. The modal cursor is the position, so + /// the walk continues from wherever j/k left it. The look may focus what + /// it opened; focus comes back here so the next n keeps stepping. + fn lookStep(p: *Pardes, pane: *Pane, pl: PaneLines, delta: i32) void { + const id = p.active; + const nrows: i32 = @intCast(pl.lines.len); + var realbuf: [4096]u8 = undefined; + var r = pane.cur_row + delta; + while (r >= 0 and r < nrows) : (r += delta) { + const ln = pl.lines[@intCast(r)]; + var hi: usize = 0; + while (hi < ln.len and look.isFileChar(ln[hi])) hi += 1; + if (hi == 0 or look.resolve(ln[0..hi], pane.cwdSlice(), &realbuf) == .none) continue; + pane.msel = .{ .active = true, .r0 = r, .r1 = r }; + pane.vsel.active = false; + pane.cur_row = r; + pane.cur_col = 0; + pane.cur_off = 0; + pane.cur_pinned = true; + pane.ensureCursorVisible(); + p.actOnSelection(.right, id, ln[0..hi], null); + p.active = id; + return; + } + // nothing lookable that way: stay put + } + const InsertAt = enum { at, append, line_start, line_end, open_below, open_above }; fn enterInsert(p: *Pardes, pane: *Pane, where: InsertAt) void { diff --git a/test/snapshots/ttylook.golden b/test/snapshots/ttylook.golden new file mode 100644 index 00000000..ce42d94f --- /dev/null +++ b/test/snapshots/ttylook.golden @@ -0,0 +1,279 @@ +== snap lsrow grid=120x30 cursor=2,2 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/ttylook/cwd/big.txt Save Del nm /tmp/pardes-snap/ttylook/cwd Del +| 1 line 1 +| 2 line 2 big.txt plain.txt sub +| 3 line 3 +| 4 line 4 +| 5 line 5 +| 6 line 6 +| 7 line 7 +| 8 line 8 +| 9 line 9 +| nm /tmp/pardes-snap/ttylook/cwd Del +| big.txt:20 +| ww +| +| plain.txt +| big.txt:33 +| zz +| +| DONE +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| +| big.txt plain.txt sub +| +| +| +| +| +| +== style lsrow +|0: 0-44 #969696,#2c2a3e, 45-119 d,#2c2a3e, +|1: 0-1 d,#383c54, 2-49 #969696,#2c2a3e, 50-59 d,#2c2a3e, 60-61 d,#383c54, 62-96 #969696,#2c2a3e, 97-119 d,#2c2a3e, +|2: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|3: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|4: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|5: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|6: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|7: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|8: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|9: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|10: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|11: 0-1 d,#6e4fd0, 2-36 #969696,#2c2a3e, 37-59 d,#2c2a3e, 60-61 d,#525252, 62-119 d,d, +|12: 0-1 d,#2a2a2a, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|13: 0-1 d,#2a2a2a, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|14: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|15: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|16: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|17: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|18: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|19: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|20: 0-1 d,#2a2a2a, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|21: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-59 d,#2c2a3e, 60-61 d,#525252, 62-119 d,d, +|22: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|23: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|24: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|25: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|26: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|27: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|28: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|29: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +== snap line20 grid=120x30 cursor=2,12 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/ttylook/cwd/big.txt Save Del nm /tmp/pardes-snap/ttylook/cwd Del +| 20 line 20 +| 21 line 21 big.txt plain.txt sub +| 22 line 22 +| 23 line 23 +| 24 line 24 +| 25 line 25 +| 26 line 26 +| 27 line 27 +| 28 line 28 +| nm /tmp/pardes-snap/ttylook/cwd Del +| big.txt:20 +| ww +| +| plain.txt +| big.txt:33 +| zz +| +| DONE +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| +| big.txt plain.txt sub +| +| +| +| +| +| +== snap plain grid=120x30 cursor=2,15 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/ttylook/cwd/big.txt Save Del nm /tmp/pardes-snap/ttylook/cwd Del +| 20 line 20 +| 21 line 21 big.txt plain.txt sub +| 22 line 22 +| 23 line 23 +| nm /tmp/pardes-snap/ttylook/cwd/plain.txt Save Del +| 1 just text +| +| +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| big.txt:20 +| ww +| +| plain.txt +| big.txt:33 +| zz +| +| DONE +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| +| big.txt plain.txt sub +| +| +| +| +| +| +== snap line33 grid=120x30 cursor=2,16 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/ttylook/cwd/big.txt Save Del nm /tmp/pardes-snap/ttylook/cwd Del +| 33 line 33 +| 34 line 34 big.txt plain.txt sub +| 35 line 35 +| 36 line 36 +| nm /tmp/pardes-snap/ttylook/cwd/plain.txt Save Del +| 1 just text +| +| +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| big.txt:20 +| ww +| +| plain.txt +| big.txt:33 +| zz +| +| DONE +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| +| big.txt plain.txt sub +| +| +| +| +| +| +== snap back grid=120x30 cursor=2,15 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/ttylook/cwd/big.txt Save Del nm /tmp/pardes-snap/ttylook/cwd Del +| 33 line 33 +| 34 line 34 big.txt plain.txt sub +| 35 line 35 +| 36 line 36 +| nm /tmp/pardes-snap/ttylook/cwd/plain.txt Save Del +| 1 just text +| +| +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| big.txt:20 +| ww +| +| plain.txt +| big.txt:33 +| zz +| +| DONE +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| +| big.txt plain.txt sub +| +| +| +| +| +| +== style back +|0: 0-44 #969696,#2c2a3e, 45-119 d,#2c2a3e, +|1: 0-1 d,#383c54, 2-49 #969696,#2c2a3e, 50-59 d,#2c2a3e, 60-61 d,#383c54, 62-96 #969696,#2c2a3e, 97-119 d,#2c2a3e, +|2: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|3: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|4: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|5: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|6: 0-1 d,#383c54, 2-51 #969696,#2c2a3e, 52-59 d,#2c2a3e, 60-61 d,#525252, 62-119 d,d, +|7: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|8: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|9: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|10: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-59 d,d, 60-61 d,#525252, 62-119 d,d, +|11: 0-1 d,#6e4fd0, 2-36 #969696,#2c2a3e, 37-59 d,#2c2a3e, 60-61 d,#525252, 62-119 d,d, +|12: 0-1 d,#2a2a2a, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|13: 0-1 d,#2a2a2a, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|14: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|15: 0-1 d,#525252, 2-59 #d8c8a8,#4a3a1e, 60-61 d,#525252, 62-119 d,d, +|16: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|17: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|18: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|19: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|20: 0-1 d,#2a2a2a, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|21: 0-1 d,#383c54, 2-36 #969696,#2c2a3e, 37-59 d,#2c2a3e, 60-61 d,#525252, 62-119 d,d, +|22: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|23: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|24: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|25: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|26: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|27: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|28: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +|29: 0-1 d,#525252, 2-59 d,d, 60-61 d,#525252, 62-119 d,d, +== snap insert grid=120x30 cursor=2,15 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/ttylook/cwd/big.txt Save Del nm /tmp/pardes-snap/ttylook/cwd Del +| 33 line 33 +| 34 line 34 big.txt plain.txt sub +| 35 line 35 +| 36 line 36 +| nm /tmp/pardes-snap/ttylook/cwd/plain.txt Save Del +| 1 just text +| +| +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| big.txt:20 +| ww +| +| nnplain.txt +| big.txt:33 +| zz +| +| DONE +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| +| big.txt plain.txt sub +| +| +| +| +| +| +== snap noop grid=120x30 cursor=2,17 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/ttylook/cwd/big.txt Save Del nm /tmp/pardes-snap/ttylook/cwd Del +| 33 line 33 +| 34 line 34 big.txt plain.txt sub +| 35 line 35 +| nm /tmp/pardes-snap/ttylook/cwd/plain.txt Save Del +| 1 just text +| +| +| nm /tmp/pardes-snap/ttylook/cwd Del +| plain.txt +| big.txt:33 +| zz +| +| DONE +| +| nm /tmp/pardes-snap/ttylook/cwd/sub Del +| +| big.txt plain.txt sub +| +| +| qq +| rr +| nm /tmp/pardes-snap/ttylook/cwd Del +| +| big.txt plain.txt sub +| +| +| +| diff --git a/test/snapshots/ttylook.snap b/test/snapshots/ttylook.snap new file mode 100644 index 00000000..648dcd42 --- /dev/null +++ b/test/snapshots/ttylook.snap @@ -0,0 +1,77 @@ +# tty n/N look-motion (normal mode only): n selects the next output row of +# the terminal whose leading file-ish word looks somewhere (file, path:NNN — +# resolved by the look machinery, prompt/echo rows blanked via the OSC 133 +# marks) and looks it; plain rows are skipped; N steps back up. Insert-mode +# n still types (run splice); with nothing lookable n is a no-op. +lines big.txt 40 +file plain.txt just text +dirmk sub +start 30 120 +wait 8000 big.txt +stable 700 20000 +# real shell output mixing lookable and plain rows (two short printfs so the +# echoes never wrap; echo rows are prompt-marked and invisible to the walk) +key c-b +stable 600 8000 +text printf 'zz\nbig.txt:20\nww\n' +key enter +text printf 'plain.txt\nbig.txt:33\nzz\n' +key enter +text echo DO''NE +key enter +wait 8000 DONE +stable 700 15000 +key c-b +stable 600 8000 +# from the top: n skips nothing-rows, lands on the ls row (big.txt ...) first +key g g +stable 400 5000 +key n +stable 700 15000 +snap lsrow +snapstyle lsrow +# next hits: big.txt:20 (file pane scrolls there), plain.txt, big.txt:33 +key n +stable 700 15000 +snap line20 +key n +stable 700 15000 +snap plain +key n +stable 700 15000 +snap line33 +# N walks back up to the plain.txt row +key N +stable 700 15000 +snap back +snapstyle back +# insert mode: n types (a run splice), it does not step +key i +text nn +key esc +settle 700 +stable 400 5000 +snap insert +key u +stable 400 5000 +# a shell with nothing lookable: cd into the empty subdir (the old ls row no +# longer resolves from there), print plain rows — n has nowhere to go +key a-n +stable 700 15000 +key c-b +stable 600 8000 +text cd sub +key enter +text printf 'qq\nrr\n' +key enter +text echo O''VER +key enter +wait 8000 OVER +stable 700 15000 +key c-b +stable 600 8000 +key g g +stable 400 5000 +key n +stable 400 5000 +snap noop -- cgit v1.3 From a43dc216f03c0bfed51ca539d027a90adc689ac8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 13:50:54 -0300 Subject: tty: coalesce queued input events into one frame; tracy zones behind -Dtracy The tty shell rendered (core.render + full vaxis repaint + tree-sitter re-highlight of the visible window) after EVERY event, so a wheel flick over a highlighted file was 150 re-parses and 150 terminal repaints; the gui shell drains the SDL queue before drawing and never had the issue. Now the tty loop applies every queued input event, then renders once (batch cap 64; pty output keeps a frame per chunk so progress paints and transient-state waits behave exactly as before). Measured with tracy on a 2400-line .zig scroll script: 150 highlightFileRange calls at 1.85ms mean -> 4; render pipeline total 730ms -> 64ms; 364 frames -> 39. Snap suite 18/18. Tracy: -Dtracy= compiles TracyClient.cpp into the binary and turns src/tracy.zig zones live (default off, all no-ops). Sampling, callstacks, system tracing and the crash handler are disabled: tracy's symbol worker SIGSEGVs on this binary's debug info and its crash handler then parks every thread before the first frame. Capture: tracy-capture -o t.tracy; export: tracy-csvexport t.tracy. --- .gitignore | 2 +- build.zig | 25 ++++++++++++ src/pardes.zig | 9 +++++ src/syntax.zig | 3 ++ src/tracy.zig | 50 +++++++++++++++++++++++ src/tty.zig | 126 ++++++++++++++++++++++++++++++++++----------------------- 6 files changed, 163 insertions(+), 52 deletions(-) create mode 100644 src/tracy.zig (limited to 'src/pardes.zig') diff --git a/.gitignore b/.gitignore index c006b9dd..e78d336f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ zig-pkg -zig-out +zig-out* .zig-cache/ .zig-cache/* assets/MapleMono-NF-Regular.ttf diff --git a/build.zig b/build.zig index 22dd7158..41f4c0ec 100644 --- a/build.zig +++ b/build.zig @@ -16,6 +16,7 @@ pub fn build(b: *std.Build) void { const optimize = if (is_emscripten) .ReleaseSmall else requested_optimize; const default_grammars: TreeSitterGrammars = if (is_emscripten) .minimal else .full; const tree_sitter_grammars = b.option(TreeSitterGrammars, "tree-sitter", "tree-sitter grammar set: disabled, minimal, full") orelse default_grammars; + const tracy = b.option([]const u8, "tracy", "enable Tracy profiling; supply the path to a Tracy source checkout"); // the browser shell: zig object + emcc link + html, installed to zig-out/web const web_step = b.step("web", "build the browser shell into zig-out/web (-Dplatform=web -Dtarget=wasm32-emscripten -Ddump=)"); @@ -64,8 +65,32 @@ pub fn build(b: *std.Build) void { opts.addOption(bool, "syntax_highlighting", tree_sitter_grammars != .disabled); opts.addOption(bool, "syntax_minimal_grammars", tree_sitter_grammars != .disabled); opts.addOption(bool, "syntax_full_grammars", tree_sitter_grammars == .full); + opts.addOption(bool, "enable_tracy", tracy != null); root_mod.addOptions("pardes_config", opts); + // Tracy zones (src/tracy.zig): compile the client into the binary only when + // -Dtracy= names a Tracy checkout; otherwise every zone is a no-op. + // Sampling/callstacks/system tracing stay off: tracy's symbol worker + // SIGSEGVs on this binary's debug info, and its crash handler then parks + // every thread — the app wedges before the first frame. Zones don't need + // any of it. + if (tracy) |tracy_path| { + root_mod.addIncludePath(.{ .cwd_relative = tracy_path }); + root_mod.addCSourceFile(.{ + .file = .{ .cwd_relative = b.pathJoin(&.{ tracy_path, "public", "TracyClient.cpp" }) }, + .flags = &.{ + "-DTRACY_ENABLE=1", + "-DTRACY_NO_SAMPLING", + "-DTRACY_NO_CALLSTACK", + "-DTRACY_NO_SYSTEM_TRACING", + "-DTRACY_NO_CRASH_HANDLER", + "-DTRACY_NO_CODE_TRANSFER", + "-fno-sanitize=undefined", + }, + }); + root_mod.link_libcpp = true; + } + // tree-sitter: the zig bindings + C runtime, one static lib per grammar, // and each grammar's highlights.scm slurped at build time into the // ts_queries options module (codegen consumed by comptime in syntax.zig). diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..63943c04 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -14,6 +14,7 @@ const uucode = @import("uucode"); const modal = @import("modal.zig"); const look = @import("look.zig"); const syntax = @import("syntax.zig"); +const tracy = @import("tracy.zig"); pub const image = @import("image.zig"); pub const dump = @import("dump.zig"); @@ -3077,6 +3078,8 @@ pub const Pardes = struct { /// re-highlight the visible window of any file whose syntax went stale /// (edit, scroll, load) — visible-range-first so big files stay snappy fn refreshDirtyHighlights(p: *Pardes) void { + const tz = tracy.zone(@src(), "refreshDirtyHighlights"); + defer tz.end(); for (p.panes) |slot| { const pane = slot orelse continue; if (pane.file == null) continue; @@ -3226,6 +3229,8 @@ pub const Pardes = struct { } fn renderPane(p: *Pardes, arena: std.mem.Allocator, pane: *Pane, r: Rect, active: bool) !void { + const tz = tracy.zone(@src(), "renderPane"); + defer tz.end(); if (r.w <= GUTTER or r.h == 0) return; const s = &p.surface; const th = p.theme(); @@ -3278,7 +3283,9 @@ pub const Pardes = struct { .fg = if (th.fg) |c| .{ .rgb = c } else .default, .bg = if (th.bg) |c| .{ .rgb = c } else .default, }; + const tz_body = tracy.zone(@src(), "bodyText"); const body = try p.bodyText(arena, pane); + tz_body.end(); var it = std.mem.splitScalar(u8, body, '\n'); var i: u16 = 0; while (it.next()) |line| : (i += 1) { @@ -3303,6 +3310,8 @@ pub const Pardes = struct { // tree-sitter style byte; content starts after the lineno gutter if (p.colors_on) if (pane.file) |*f| { if (f.highlights.len > 0) { + const tz_recolor = tracy.zone(@src(), "synRecolor"); + defer tz_recolor.end(); var flines = std.mem.splitScalar(u8, f.content, '\n'); var skip: usize = 0; while (skip < f.scroll) : (skip += 1) { diff --git a/src/syntax.zig b/src/syntax.zig index a9914fd7..0d2fa291 100644 --- a/src/syntax.zig +++ b/src/syntax.zig @@ -4,6 +4,7 @@ //! compiles queries at startup; `full` adds ~23 languages lazily on first use. const std = @import("std"); const config = @import("pardes_config"); +const tracy = @import("tracy.zig"); pub const enabled = config.syntax_highlighting; const minimal_grammars = config.syntax_minimal_grammars; @@ -140,6 +141,8 @@ pub fn highlightFile(gpa: std.mem.Allocator, path: []const u8, content: []const /// One Syn byte per content byte in [start, end). Caller frees. pub fn highlightFileRange(gpa: std.mem.Allocator, path: []const u8, content: []const u8, start_byte_raw: usize, end_byte_raw: usize) ![]u8 { + const tz = tracy.zone(@src(), "highlightFileRange"); + defer tz.end(); if (!enabled) return &.{}; const ext = std.fs.path.extension(path); const selected = (forExt(ext) catch return &.{}) orelse return &.{}; diff --git a/src/tracy.zig b/src/tracy.zig new file mode 100644 index 00000000..3b0b8621 --- /dev/null +++ b/src/tracy.zig @@ -0,0 +1,50 @@ +//! Minimal Tracy client (the Zig compiler's pattern): `zone(@src(), "name")` +//! ... `.end()`, plus `frameMark()`. Everything compiles to a no-op unless the +//! build sets -Dtracy=, which also compiles and links +//! TracyClient.cpp. Capture with tracy-capture, inspect with tracy-csvexport. +const std = @import("std"); +const builtin = @import("builtin"); + +pub const enable = if (builtin.is_test) false else @import("pardes_config").enable_tracy; + +const SourceLocation = extern struct { + name: ?[*:0]const u8, + function: [*:0]const u8, + file: [*:0]const u8, + line: u32, + color: u32, +}; + +pub const Ctx = if (enable) extern struct { + id: u32, + active: i32, + + pub inline fn end(c: @This()) void { + ___tracy_emit_zone_end(c); + } +} else struct { + pub inline fn end(_: @This()) void {} +}; + +pub inline fn zone(comptime src: std.builtin.SourceLocation, comptime name: [:0]const u8) Ctx { + if (!enable) return .{}; + const static = struct { + const loc: SourceLocation = .{ + .name = name.ptr, + .function = src.fn_name.ptr, + .file = src.file.ptr, + .line = src.line, + .color = 0, + }; + }; + return ___tracy_emit_zone_begin(&static.loc, 1); +} + +pub inline fn frameMark() void { + if (!enable) return; + ___tracy_emit_frame_mark(null); +} + +extern fn ___tracy_emit_zone_begin(srcloc: *const SourceLocation, active: c_int) Ctx; +extern fn ___tracy_emit_zone_end(ctx: Ctx) void; +extern fn ___tracy_emit_frame_mark(name: ?[*:0]const u8) void; diff --git a/src/tty.zig b/src/tty.zig index d9821343..3290cde9 100644 --- a/src/tty.zig +++ b/src/tty.zig @@ -7,6 +7,7 @@ const posix = std.posix; const linux = std.os.linux; const vaxis = @import("vaxis"); const pardes = @import("pardes.zig"); +const tracy = @import("tracy.zig"); extern "c" fn forkpty(amaster: *c_int, name: ?[*:0]u8, termp: ?*const anyopaque, winp: ?*const posix.winsize) c_int; extern "c" fn execv(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) c_int; @@ -87,61 +88,77 @@ pub fn run(init: std.process.Init, opts: pardes.Options) !void { var pending: ?@TypeOf(Command.value) = .tick; while (!core.quit) { - const event = if (pending) |ev| blk: { + var event = if (pending) |ev| blk: { pending = null; break :blk ev; } else try loop.nextEvent(); - switch (event) { - .nop, .tick => {}, - .quit => break, - .winsize => |ws| { - try vx.resize(gpa, tty.writer(), ws); - core.update(.{ .resize = .{ .cols = @intCast(ws.cols), .rows = @intCast(ws.rows) } }); - }, - .pty_read => |pr| { - core.update(.{ .output = .{ .pane = @intCast(pr.id), .bytes = pr.bytes } }); - gpa.free(pr.bytes); - }, - .pty_eof => |id| { - if (ptys[id]) |*pt| { - _ = linux.close(pt.file.handle); - ptys[id] = null; - } - core.update(.{ .eof = .{ .pane = @intCast(id) } }); - }, - .key_press => |key| core.update(.{ .key = .{ - .cp = mapKey(effCp(key)), - .text = key.text orelse "", - .ctrl = key.mods.ctrl, - .alt = key.mods.alt, - } }), - .mouse => |m| { - const button: ?pardes.Mouse.Button = switch (m.button) { - .left => .left, - .middle => .middle, - .right => .right, - .wheel_up => .wheel_up, - .wheel_down => .wheel_down, - .none => .none, // button-less motion: hover tracking - else => null, - }; - if (button) |b| core.update(.{ .mouse = .{ - .button = b, - .kind = switch (m.type) { - .press => .press, - .release => .release, - .motion => .motion, - .drag => .drag, - }, - .col = @intCast(m.col), - .row = @intCast(m.row), - } }); - }, - .paste => |bytes| { - core.update(.{ .paste = bytes }); - gpa.free(@constCast(bytes)); - }, + const tz_event = tracy.zone(@src(), "event"); + // Apply every queued INPUT event, then render ONCE — the gui shell + // drains SDL's queue the same way. Without this a wheel flick is fifty + // full render+repaint (and re-highlight) cycles instead of one. + // pty output keeps a frame per chunk: progress paints as it arrives. + var stop = false; + var batch: usize = 0; + while (true) { + var output = false; + switch (event) { + .nop, .tick => {}, + .quit => stop = true, + .winsize => |ws| { + try vx.resize(gpa, tty.writer(), ws); + core.update(.{ .resize = .{ .cols = @intCast(ws.cols), .rows = @intCast(ws.rows) } }); + }, + .pty_read => |pr| { + core.update(.{ .output = .{ .pane = @intCast(pr.id), .bytes = pr.bytes } }); + gpa.free(pr.bytes); + output = true; + }, + .pty_eof => |id| { + if (ptys[id]) |*pt| { + _ = linux.close(pt.file.handle); + ptys[id] = null; + } + core.update(.{ .eof = .{ .pane = @intCast(id) } }); + }, + .key_press => |key| core.update(.{ .key = .{ + .cp = mapKey(effCp(key)), + .text = key.text orelse "", + .ctrl = key.mods.ctrl, + .alt = key.mods.alt, + } }), + .mouse => |m| { + const button: ?pardes.Mouse.Button = switch (m.button) { + .left => .left, + .middle => .middle, + .right => .right, + .wheel_up => .wheel_up, + .wheel_down => .wheel_down, + .none => .none, // button-less motion: hover tracking + else => null, + }; + if (button) |b| core.update(.{ .mouse = .{ + .button = b, + .kind = switch (m.type) { + .press => .press, + .release => .release, + .motion => .motion, + .drag => .drag, + }, + .col = @intCast(m.col), + .row = @intCast(m.row), + } }); + }, + .paste => |bytes| { + core.update(.{ .paste = bytes }); + gpa.free(@constCast(bytes)); + }, + } + batch += 1; + if (stop or output or batch >= 64) break; + event = (try loop.tryEvent()) orelse break; } + tz_event.end(); + if (stop) break; drainEffects(core, &ptys, io, gpa, &loop, &vx, &tty, true); if (core.quit) break; @@ -158,7 +175,10 @@ pub fn run(init: std.process.Init, opts: pardes.Options) !void { // ---- render: surface -> vaxis, cell for cell ---- _ = frame_arena.reset(.retain_capacity); + const tz_core = tracy.zone(@src(), "core.render"); const surface = try core.render(frame_arena.allocator()); + tz_core.end(); + const tz_cells = tracy.zone(@src(), "surface->vaxis"); const win = vx.window(); win.clear(); var y: u16 = 0; @@ -173,6 +193,7 @@ pub fn run(init: std.process.Init, opts: pardes.Options) !void { }); } } + tz_cells.end(); // pixel attachments (kitty graphics): transmit once per pane, then // re-place every frame (placements aren't persistent) for (surface.images[0..surface.nimages]) |maybe| { @@ -191,7 +212,10 @@ pub fn run(init: std.process.Init, opts: pardes.Options) !void { } } if (surface.cursor) |cur| win.showCursor(cur.x, cur.y); + const tz_render = tracy.zone(@src(), "vx.render"); try vx.render(tty.writer()); + tz_render.end(); + tracy.frameMark(); } } -- cgit v1.3 From 04cd5a2b41efd6f39c3ba15c32e60843e2c6485d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 13:10:53 -0300 Subject: layout: every pane open/close resizes exactly ONE sibling — never the whole column. Buggy paths fixed: Alt-n inserted a weight-1 shell (whole column reflowed) — now splitBelow the active pane; stackDocLeft (file/image/tutor open with no doc yet) gave the doc a fair share (every pane shrank) — now it halves only the old top pane's slot; ttyForDir (execute from a file pane) appended a weight-1 shell to the rightmost column — now splitBelow its bottom pane; Alt-c moved a pane out without absorbVWeight (all old siblings grew) — now the sibling above absorbs first. Underneath: splitBelow/absorbVWeight/stackDocLeft snap the whole column's weights to on-screen row counts, because computeGeom's per-pane round(avail*w/vsum) let fractional weights jiggle bystanders by a row; evictLonePristineTty recomputes geometry first (a just-stacked doc has no rect). New snap tests layout-open + layout-close cover Alt-n, doc stacking, ttyForDir, Alt-c, tag Del, pty EOF, and column-width handoff. Six goldens regenerated (fileedit, images, look-file, syntax, tutor, windowops): they had frozen the fair-share/append reflow this change removes; every diff is only the doc/split pane sizing, with untouched panes' boundaries restored bit-identical (e.g. bottom pane tag back at its boot row 17 instead of pushed to 22). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pardes.zig | 59 +++++++---- test/snapshots/fileedit.golden | 30 +++--- test/snapshots/images.golden | 94 ++++++++--------- test/snapshots/layout-close.golden | 205 +++++++++++++++++++++++++++++++++++++ test/snapshots/layout-close.snap | 53 ++++++++++ test/snapshots/layout-open.golden | 155 ++++++++++++++++++++++++++++ test/snapshots/layout-open.snap | 55 ++++++++++ test/snapshots/look-file.golden | 28 ++--- test/snapshots/syntax.golden | 46 ++++----- test/snapshots/tutor.golden | 8 +- test/snapshots/windowops.golden | 58 +++++------ 11 files changed, 640 insertions(+), 151 deletions(-) create mode 100644 test/snapshots/layout-close.golden create mode 100644 test/snapshots/layout-close.snap create mode 100644 test/snapshots/layout-open.golden create mode 100644 test/snapshots/layout-open.snap (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..13b159aa 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1145,12 +1145,14 @@ pub const Pardes = struct { nt.greet = true; const f = p.layoutFindTerm(p.active).?; p.layoutInsert(f.col, f.idx + 1, free); + p.splitBelow(p.active, nt); p.active = free; return; } if (key.alt and !key.ctrl and key.cp == 'c') { const f = p.layoutFindTerm(p.active).?; if (p.ncol < MAX_COLS and p.col_n[f.col] > 1) { + p.absorbVWeight(p.active); p.layoutRemove(p.active); p.layoutAppendColumn(p.active); } @@ -2433,29 +2435,47 @@ pub const Pardes = struct { p.ncol += 1; } - /// Hand a dying pane's vertical weight to ONE sibling (the pane above, or - /// below for the topmost) so the rest of the column keeps its sizes — the - /// deletion mirror of splitBelow. Call while `id` is still in the layout. + /// Snap every pane in column `c` to its on-screen row count so later + /// weight edits move ONLY the panes they name: computeGeom rounds + /// round(avail*w/vsum) per pane, and with fractional weights a split or + /// absorb elsewhere in the column can jiggle a bystander by a row. + fn snapColWeights(p: *Pardes, c: usize) void { + for (0..p.col_n[c]) |k| { + const pid = p.col_terms[c][k]; + if (p.panes[pid]) |pp| pp.vweight = @floatFromInt(@max(1, p.rects[pid].h)); + } + } + + /// Hand a dying pane's rows to ONE sibling (the pane above, or below for + /// the topmost) so the rest of the column keeps its sizes bit-identical — + /// the deletion mirror of splitBelow. Call while `id` is still in the + /// layout, with rects current. fn absorbVWeight(p: *Pardes, id: usize) void { const f = p.layoutFindTerm(id) orelse return; if (p.col_n[f.col] <= 1) return; - const gone = p.panes[id] orelse return; + p.snapColWeights(f.col); const sib = if (f.idx > 0) p.col_terms[f.col][f.idx - 1] else p.col_terms[f.col][f.idx + 1]; - if (p.panes[sib]) |s| s.vweight += gone.vweight; + if (p.panes[sib]) |s| s.vweight += @as(f32, @floatFromInt(@max(1, p.rects[id].h))); } /// Open a window BELOW `src` (acme-style) without rebalancing the column: /// shrink ONLY src to its content height (cursor row kept visible) and hand - /// the freed rows to `nw` — together they fill src's old slot. + /// the freed rows to `nw` — together they fill src's old slot and the other + /// panes keep their sizes bit-identical (weights snap to row counts). fn splitBelow(p: *Pardes, src_id: usize, nw: *Pane) void { const src = p.panes[src_id] orelse return; const src_h = p.rects[src_id].h; const body: u16 = if (src_h > BOX_H) src_h - BOX_H else 1; const cur: u16 = if (src.file != null) body / 2 else @as(u16, @intCast(src.vt.screens.active.cursor.y)) + 1; const keep = std.math.clamp(cur, 1, @max(1, body -| 1)); - const w = src.vweight; - src.vweight = w * @as(f32, @floatFromInt(BOX_H + keep)) / @as(f32, @floatFromInt(src_h)); - nw.vweight = w - src.vweight; + if (p.layoutFindTerm(src_id)) |f| for (0..p.col_n[f.col]) |k| { + const pid = p.col_terms[f.col][k]; + if (p.panes[pid]) |pp| if (pp != nw) { + pp.vweight = @floatFromInt(@max(1, p.rects[pid].h)); + }; + }; + src.vweight = @floatFromInt(BOX_H + keep); + nw.vweight = @floatFromInt(@max(1, src_h -| (BOX_H + keep))); } /// a shell nobody has touched: no typing, cursor on the first prompt line, @@ -2482,6 +2502,7 @@ pub const Pardes = struct { if (n_tty != 1) return; const tt = p.panes[tty_id] orelse return; if (!isPristineTty(tt)) return; + p.computeGeom(); // a just-stacked doc has no rect yet; absorb snaps to rows p.absorbVWeight(tty_id); p.layoutRemove(tty_id); p.deinitPane(tt); @@ -2501,6 +2522,7 @@ pub const Pardes = struct { const nt = p.newShell(free, dir) catch return null; nt.greet = false; const rc = if (p.ncol > 0) p.ncol - 1 else 0; + if (p.col_n[rc] > 0) p.splitBelow(p.col_terms[rc][p.col_n[rc] - 1], nt); p.layoutInsert(rc, p.col_n[rc], free); return free; } @@ -2558,18 +2580,17 @@ pub const Pardes = struct { } /// stack a fresh doc pane at the top of the LEFT column (acme convention: - /// files left, terminals right) with a fair share, then evict a leftover - /// pristine shell + /// files left, terminals right), halving ONLY the old top pane's slot so + /// the rest of the column keeps its sizes; then evict a leftover pristine + /// shell fn stackDocLeft(p: *Pardes, free: usize, nt: *Pane) void { const lc = 0; - const ln = p.col_n[lc]; - if (ln > 0) { - var vsum: f32 = 0; - for (0..ln) |i| if (p.panes[p.col_terms[lc][i]]) |pp| { - vsum += pp.vweight; - }; - nt.vweight = vsum / @as(f32, @floatFromInt(ln)); - } + if (p.col_n[lc] > 0) if (p.panes[p.col_terms[lc][0]]) |top| { + p.snapColWeights(lc); + const h = p.rects[p.col_terms[lc][0]].h; + nt.vweight = @floatFromInt(@max(1, h / 2)); + top.vweight = @floatFromInt(@max(1, h -| h / 2)); + }; p.layoutInsert(lc, 0, free); p.active = free; p.evictLonePristineTty(lc, free); diff --git a/test/snapshots/fileedit.golden b/test/snapshots/fileedit.golden index c6fb40aa..a1709691 100644 --- a/test/snapshots/fileedit.golden +++ b/test/snapshots/fileedit.golden @@ -7,9 +7,6 @@ | 4 line 4 | 5 line 5 | 6 line 6 -| 7 line 7 -| 8 line 8 -| 9 line 9 | nm /tmp/pardes-snap/fileedit/cwd Del | | f.txt @@ -18,8 +15,6 @@ | | f.txt | -| -| | nm /tmp/pardes-snap/fileedit/cwd Del | | f.txt @@ -29,6 +24,11 @@ | | | +| +| +| +| +| == snap deleted grid=100x30 cursor=7,3 |Kill Newcol Tutor Debug Colors NextColor Dump | nm /tmp/pardes-snap/fileedit/cwd/f.txt Save Del nm /tmp/pardes-snap/fileedit/cwd Del @@ -38,9 +38,6 @@ | 4 line 5 | 5 line 6 | 6 line 7 -| 7 line 8 -| 8 line 9 -| 9 line 10 | nm /tmp/pardes-snap/fileedit/cwd Del | | f.txt @@ -49,8 +46,6 @@ | | f.txt | -| -| | nm /tmp/pardes-snap/fileedit/cwd Del | | f.txt @@ -60,6 +55,11 @@ | | | +| +| +| +| +| == snap undone grid=100x30 cursor=7,3 |Kill Newcol Tutor Debug Colors NextColor Dump | nm /tmp/pardes-snap/fileedit/cwd/f.txt Save Del nm /tmp/pardes-snap/fileedit/cwd Del @@ -69,9 +69,6 @@ | 4 line 4 | 5 line 5 | 6 line 6 -| 7 line 7 -| 8 line 8 -| 9 line 9 | nm /tmp/pardes-snap/fileedit/cwd Del | | f.txt @@ -80,8 +77,6 @@ | | f.txt | -| -| | nm /tmp/pardes-snap/fileedit/cwd Del | | f.txt @@ -91,6 +86,11 @@ | | | +| +| +| +| +| == file saved liEDIT''MEne 1 line 2 diff --git a/test/snapshots/images.golden b/test/snapshots/images.golden index b6e75fbf..16dc0bac 100644 --- a/test/snapshots/images.golden +++ b/test/snapshots/images.golden @@ -1,15 +1,12 @@ == snap img-open grid=100x30 cursor=4,7 |Kill Newcol Tutor Debug Colors NextColor Dump | img /tmp/pardes-snap/images/cwd/pic.ppm Petscii nm /tmp/pardes-snap/images/cwd Del -| 🬝🬹 -| 🬝▀█ pic.ppm -| 🬝▀█ -| 🬝▀█ -| 🬝▀█ -| █🬆█ -| █🬆█ -| █🬆█ -| 🬝🬹█ +| 🬝🬂 +| 🬝🬂█ pic.ppm +| 🬝🬂█ +| 🬝🬂 +| 🬝🬂█ +|╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ | nm /tmp/pardes-snap/images/cwd Del | | pic.ppm @@ -18,8 +15,6 @@ | | pic.ppm | -| -| | nm /tmp/pardes-snap/images/cwd Del | | pic.ppm @@ -29,29 +24,34 @@ | | | +| +| +| +| +| == style img-open |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, |1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, -|2: 0-1 d,#2a2a2a, 2-16 d,d, 17-32 #ffffff,#ffffff, 33-33 #ffffff,#352879, 34-34 #352879,#ffffff, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|3: 0-1 d,#2a2a2a, 2-16 d,d, 17-30 #ffffff,#ffffff, 31-32 #ffffff,#352879, 33-33 #352879,#ffffff, 34-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|4: 0-1 d,#2a2a2a, 2-16 d,d, 17-28 #ffffff,#ffffff, 29-30 #ffffff,#352879, 31-31 #352879,#ffffff, 32-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|5: 0-1 d,#2a2a2a, 2-16 d,d, 17-26 #ffffff,#ffffff, 27-28 #ffffff,#352879, 29-29 #352879,#ffffff, 30-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|6: 0-1 d,#2a2a2a, 2-16 d,d, 17-24 #ffffff,#ffffff, 25-26 #ffffff,#352879, 27-27 #352879,#ffffff, 28-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|7: 0-1 d,#2a2a2a, 2-16 d,d, 17-22 #ffffff,#ffffff, 23-24 #ffffff,#352879, 25-25 #352879,#ffffff, 26-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|8: 0-1 d,#2a2a2a, 2-16 d,d, 17-20 #ffffff,#ffffff, 21-22 #ffffff,#352879, 23-23 #352879,#ffffff, 24-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|9: 0-1 d,#2a2a2a, 2-16 d,d, 17-18 #ffffff,#ffffff, 19-20 #ffffff,#352879, 21-21 #352879,#ffffff, 22-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|10: 0-1 d,#2a2a2a, 2-16 d,d, 17-17 #ffffff,#352879, 18-19 #352879,#ffffff, 20-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|2: 0-1 d,#2a2a2a, 2-19 d,d, 20-29 #ffffff,#ffffff, 30-31 #ffffff,#6c5eb5, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|3: 0-1 d,#2a2a2a, 2-19 d,d, 20-27 #ffffff,#ffffff, 28-29 #ffffff,#6c5eb5, 30-30 #352879,#ffffff, 31-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|4: 0-1 d,#2a2a2a, 2-19 d,d, 20-25 #ffffff,#ffffff, 26-27 #ffffff,#6c5eb5, 28-28 #352879,#ffffff, 29-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|5: 0-1 d,#2a2a2a, 2-19 d,d, 20-23 #ffffff,#ffffff, 24-25 #ffffff,#6c5eb5, 26-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|6: 0-1 d,#2a2a2a, 2-19 d,d, 20-21 #ffffff,#ffffff, 22-23 #ffffff,#6c5eb5, 24-24 #352879,#ffffff, 25-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|7: 0-1 d,#2a2a2a, 2-19 d,d, 20-21 #ffffff,#6c5eb5, 22-22 #352879,#ffffff, 23-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -63,26 +63,26 @@ == style term-palette |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, |1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, -|2: 0-1 d,#2a2a2a, 2-16 d,d, 17-32 #ffffff,#ffffff, 33-33 #ffffff,#352879, 34-34 #352879,#ffffff, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|3: 0-1 d,#2a2a2a, 2-16 d,d, 17-30 #ffffff,#ffffff, 31-32 #ffffff,#352879, 33-33 #352879,#ffffff, 34-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|4: 0-1 d,#2a2a2a, 2-16 d,d, 17-28 #ffffff,#ffffff, 29-30 #ffffff,#352879, 31-31 #352879,#ffffff, 32-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|5: 0-1 d,#2a2a2a, 2-16 d,d, 17-26 #ffffff,#ffffff, 27-28 #ffffff,#352879, 29-29 #352879,#ffffff, 30-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|6: 0-1 d,#2a2a2a, 2-16 d,d, 17-24 #ffffff,#ffffff, 25-26 #ffffff,#352879, 27-27 #352879,#ffffff, 28-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|7: 0-1 d,#2a2a2a, 2-16 d,d, 17-22 #ffffff,#ffffff, 23-24 #ffffff,#352879, 25-25 #352879,#ffffff, 26-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|8: 0-1 d,#2a2a2a, 2-16 d,d, 17-20 #ffffff,#ffffff, 21-22 #ffffff,#352879, 23-23 #352879,#ffffff, 24-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|9: 0-1 d,#2a2a2a, 2-16 d,d, 17-18 #ffffff,#ffffff, 19-20 #ffffff,#352879, 21-21 #352879,#ffffff, 22-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|10: 0-1 d,#2a2a2a, 2-16 d,d, 17-17 #ffffff,#352879, 18-19 #352879,#ffffff, 20-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|2: 0-1 d,#2a2a2a, 2-19 d,d, 20-29 #ffffff,#ffffff, 30-31 #ffffff,#6c5eb5, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|3: 0-1 d,#2a2a2a, 2-19 d,d, 20-27 #ffffff,#ffffff, 28-29 #ffffff,#6c5eb5, 30-30 #352879,#ffffff, 31-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|4: 0-1 d,#2a2a2a, 2-19 d,d, 20-25 #ffffff,#ffffff, 26-27 #ffffff,#6c5eb5, 28-28 #352879,#ffffff, 29-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|5: 0-1 d,#2a2a2a, 2-19 d,d, 20-23 #ffffff,#ffffff, 24-25 #ffffff,#6c5eb5, 26-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|6: 0-1 d,#2a2a2a, 2-19 d,d, 20-21 #ffffff,#ffffff, 22-23 #ffffff,#6c5eb5, 24-24 #352879,#ffffff, 25-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|7: 0-1 d,#2a2a2a, 2-19 d,d, 20-21 #ffffff,#6c5eb5, 22-22 #352879,#ffffff, 23-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -94,26 +94,26 @@ == style no-ascii |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, |1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-85 #969696,#2c2a3e, 86-99 d,#2c2a3e, -|2: 0-1 d,#2a2a2a, 2-16 d,d, 17-32 #ffffff,#ffffff, 33-33 #ffffff,#352879, 34-34 #352879,#ffffff, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|3: 0-1 d,#2a2a2a, 2-16 d,d, 17-30 #ffffff,#ffffff, 31-32 #ffffff,#352879, 33-33 #352879,#ffffff, 34-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|4: 0-1 d,#2a2a2a, 2-16 d,d, 17-28 #ffffff,#ffffff, 29-30 #ffffff,#352879, 31-31 #352879,#ffffff, 32-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|5: 0-1 d,#2a2a2a, 2-16 d,d, 17-26 #ffffff,#ffffff, 27-28 #ffffff,#352879, 29-29 #352879,#ffffff, 30-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|6: 0-1 d,#2a2a2a, 2-16 d,d, 17-24 #ffffff,#ffffff, 25-26 #ffffff,#352879, 27-27 #352879,#ffffff, 28-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|7: 0-1 d,#2a2a2a, 2-16 d,d, 17-22 #ffffff,#ffffff, 23-24 #ffffff,#352879, 25-25 #352879,#ffffff, 26-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|8: 0-1 d,#2a2a2a, 2-16 d,d, 17-20 #ffffff,#ffffff, 21-22 #ffffff,#352879, 23-23 #352879,#ffffff, 24-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|9: 0-1 d,#2a2a2a, 2-16 d,d, 17-18 #ffffff,#ffffff, 19-20 #ffffff,#352879, 21-21 #352879,#ffffff, 22-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|10: 0-1 d,#2a2a2a, 2-16 d,d, 17-17 #ffffff,#352879, 18-19 #352879,#ffffff, 20-34 #352879,#352879, 35-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|2: 0-1 d,#2a2a2a, 2-19 d,d, 20-29 #ffffff,#ffffff, 30-31 #ffffff,#6c5eb5, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|3: 0-1 d,#2a2a2a, 2-19 d,d, 20-27 #ffffff,#ffffff, 28-29 #ffffff,#6c5eb5, 30-30 #352879,#ffffff, 31-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|4: 0-1 d,#2a2a2a, 2-19 d,d, 20-25 #ffffff,#ffffff, 26-27 #ffffff,#6c5eb5, 28-28 #352879,#ffffff, 29-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|5: 0-1 d,#2a2a2a, 2-19 d,d, 20-23 #ffffff,#ffffff, 24-25 #ffffff,#6c5eb5, 26-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|6: 0-1 d,#2a2a2a, 2-19 d,d, 20-21 #ffffff,#ffffff, 22-23 #ffffff,#6c5eb5, 24-24 #352879,#ffffff, 25-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|7: 0-1 d,#2a2a2a, 2-19 d,d, 20-21 #ffffff,#6c5eb5, 22-22 #352879,#ffffff, 23-31 #352879,#352879, 32-49 d,d, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/layout-close.golden b/test/snapshots/layout-close.golden new file mode 100644 index 00000000..9557ec98 --- /dev/null +++ b/test/snapshots/layout-close.golden @@ -0,0 +1,205 @@ +== snap built grid=140x40 cursor=4,16 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-close/cwd Del nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt marker.txt +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| +| +| +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap altc grid=140x40 cursor=98,4 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-close/cwd Del nm /tmp/pardes-snap/layout-close/cwd Del nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt marker.txt marker.txt +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap del grid=140x40 cursor=98,4 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-close/cwd Del nm /tmp/pardes-snap/layout-close/cwd Del nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt marker.txt marker.txt +| +| +| +| +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap exit grid=140x40 cursor=4,7 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-close/cwd Del nm /tmp/pardes-snap/layout-close/cwd Del nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt marker.txt marker.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap colclose grid=140x40 cursor=4,7 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-close/cwd Del nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt marker.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/layout-close/cwd Del +| +| marker.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/test/snapshots/layout-close.snap b/test/snapshots/layout-close.snap new file mode 100644 index 00000000..63f5cd81 --- /dev/null +++ b/test/snapshots/layout-close.snap @@ -0,0 +1,53 @@ +# every pane close hands its space to ONE sibling, the rest of the column +# keeps its sizes: Alt-c move-out, tag Del, and shell exit (pty EOF); an +# emptied column hands its width to one neighbor +file marker.txt x +start 40 140 +wait 8000 marker.txt +stable 700 20000 +# build a left column of five: Alt-n three times from pane 0 (active follows +# the new pane, each split takes from the freshly split pane only) +press left 5 8 +release left 5 8 +stable 400 5000 +key a-n +stable 700 15000 +key a-n +stable 700 15000 +key a-n +stable 700 15000 +snap built +# Alt-c: the active (4th) pane moves to a fresh column; the pane above it +# absorbs its rows, the other three keep theirs (columns reflow horizontally) +key a-c +stable 700 15000 +snap altc +# middle-click Del in the 2nd pane's tag: the pane above absorbs +press middle 41 6 +release middle 41 6 +stable 700 10000 +snap del +# exit the (now) 2nd shell (type the command, esc, Tab executes the word): +# pty EOF, again only the pane above absorbs +press left 5 14 +release left 5 14 +stable 400 5000 +key i +text exit +key esc +settle 700 +key tab +stable 700 10000 +snap exit +# exit the moved-out pane's shell: its column empties and hands its width to +# the middle column only; the left column's width must not change +press left 100 8 +release left 100 8 +stable 400 5000 +key i +text exit +key esc +settle 700 +key tab +stable 700 10000 +snap colclose diff --git a/test/snapshots/layout-open.golden b/test/snapshots/layout-open.golden new file mode 100644 index 00000000..2da61d61 --- /dev/null +++ b/test/snapshots/layout-open.golden @@ -0,0 +1,155 @@ +== snap before grid=100x30 cursor=4,7 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-open/cwd Del nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub sub +| +| +| +| echo one; echo two +| +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub +| +| +| +| +| +| +| +| +| +| +| +== snap altn-left grid=100x30 cursor=4,8 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-open/cwd Del nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub sub +| +| nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub +| +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub +| +| +| +| +| +| +| +| +| +| +| +== snap altn-right grid=100x30 cursor=54,8 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-open/cwd Del nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub sub +| +| nm /tmp/pardes-snap/layout-open/cwd Del nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub sub +| +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub +| +| +| +| +| +| +| +| +| +| +| +== snap file-open grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-open/cwd/sub/f.txt Sa nm /tmp/pardes-snap/layout-open/cwd Del +| 1 echo 'TTY'OK +| nm /tmp/pardes-snap/layout-open/cwd Del sub +| +| nm /tmp/pardes-snap/layout-open/cwd Del nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub sub +| +| +| +| +| +| +| +| +| nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub +| +| +| +| +| +| +| +| sub/f.txt +| +| +| +== snap ttydir grid=100x30 cursor=7,2 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/layout-open/cwd/sub/f.txt Sa nm /tmp/pardes-snap/layout-open/cwd Del +| 1 echo 'TTY'OK +| nm /tmp/pardes-snap/layout-open/cwd Del sub +| +| nm /tmp/pardes-snap/layout-open/cwd Del nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub sub +| +| nm /tmp/pardes-snap/layout-open/cwd/sub Del +| echo 'TTY'OK +| +| TTYOK +| +| +| +| nm /tmp/pardes-snap/layout-open/cwd Del +| +| sub +| +| +| +| +| +| +| +| sub/f.txt +| +| +| diff --git a/test/snapshots/layout-open.snap b/test/snapshots/layout-open.snap new file mode 100644 index 00000000..773cf70d --- /dev/null +++ b/test/snapshots/layout-open.snap @@ -0,0 +1,55 @@ +# every pane open splits ONE existing pane, the rest of the column keeps its +# sizes: Alt-n splits the active pane, a looked-up file stacking top-left +# splits only the old top pane, an execute-spawned shell for a file's dir +# splits only the bottom pane of the rightmost column +dirmk sub +file sub/f.txt echo 'TTY'OK +start 30 100 +wait 8000 sub +stable 700 20000 +# give pane 0 (top-left) some content so its content-height split is visible +press left 5 8 +release left 5 8 +stable 400 5000 +key i +text echo one; echo two +key enter +key esc +settle 700 +stable 400 5000 +snap before +# Alt-n: new shell below pane 0 — the bottom pane's boundary must not move +key a-n +stable 700 15000 +snap altn-left +# make the right column two panes (Alt-n in a fresh column, trivial split) +press left 70 8 +release left 70 8 +stable 400 5000 +key a-n +stable 700 15000 +snap altn-right +# look sub/f.txt from the bottom-left shell: the doc stacks at the top of the +# left column, splitting only the old top pane — lower boundaries must not move +press left 5 27 +release left 5 27 +stable 400 5000 +key i +text sub/f.txt +key esc +settle 700 +stable 400 5000 +press right 7 27 +release right 7 27 +stable 700 15000 +snap file-open +# execute the file's command (middle drag over line 1): no shell has cwd sub/, +# so one is forked at the bottom of the rightmost column, splitting only the +# pane above it +press middle 8 3 +drag middle 19 3 +release middle 19 3 +wait 10000 TTYOK +motion 40 25 +stable 700 10000 +snap ttydir diff --git a/test/snapshots/look-file.golden b/test/snapshots/look-file.golden index 4f6d4a71..9258cfdb 100644 --- a/test/snapshots/look-file.golden +++ b/test/snapshots/look-file.golden @@ -6,10 +6,7 @@ | 42 line 42 | 43 line 43 | 44 line 44 -| 45 line 45 -| 46 line 46 -| 47 line 47 -| 48 line 48 +|╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ | nm /tmp/pardes-snap/look-file/cwd Del | | big.txt @@ -18,8 +15,6 @@ | | big.txt:40 | -| -| | nm /tmp/pardes-snap/look-file/cwd Del | | big.txt @@ -29,29 +24,34 @@ | | | +| +| +| +| +| == style file-open |0: 0-44 #969696,#2c2a3e, 45-99 d,#2c2a3e, |1: 0-1 d,#6e4fd0, 2-49 #969696,#2c2a3e, 50-51 d,#383c54, 52-88 #969696,#2c2a3e, 89-99 d,#2c2a3e, |2: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |3: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |4: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|5: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|5: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |6: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|7: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|8: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|9: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|10: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|7: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/syntax.golden b/test/snapshots/syntax.golden index 310d6d64..80ef3525 100644 --- a/test/snapshots/syntax.golden +++ b/test/snapshots/syntax.golden @@ -6,24 +6,24 @@ | 3 var x: u32 = 42; | 4 _ = x; | 5 } +|╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ +| nm /tmp/pardes-snap/syntax/cwd Del | +| demo.zig | | | +| demo.zig +| | nm /tmp/pardes-snap/syntax/cwd Del | | demo.zig | | | -| demo.zig | | | -| nm /tmp/pardes-snap/syntax/cwd Del -| -| demo.zig -| | | | @@ -38,20 +38,20 @@ |5: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |6: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |7: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|8: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|9: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|10: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -69,20 +69,20 @@ |5: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |6: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |7: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|8: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|9: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|10: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, @@ -100,20 +100,20 @@ |5: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |6: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, |7: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|8: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|9: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|10: 0-1 d,#525252, 2-6 #5a5a5a,d, 7-49 d,d, 50-51 d,#525252, 52-99 d,d, -|11: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|8: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|9: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|10: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|11: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |12: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |13: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |14: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |15: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|16: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, +|16: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, |17: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |18: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |19: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |20: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, -|21: 0-1 d,#383c54, 2-35 #969696,#2c2a3e, 36-49 d,#2c2a3e, 50-51 d,#525252, 52-99 d,d, +|21: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |22: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |23: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, |24: 0-1 d,#525252, 2-49 d,d, 50-51 d,#525252, 52-99 d,d, diff --git a/test/snapshots/tutor.golden b/test/snapshots/tutor.golden index 55d66c9b..aa000798 100644 --- a/test/snapshots/tutor.golden +++ b/test/snapshots/tutor.golden @@ -7,9 +7,6 @@ | 4 | 5 The model is acme's: EVERYTHING is | 6 the same way. Modal editing (helix- -| 7 Press j until you reach the introdu -| 8 -| 9 | nm /tmp/pardes-snap/tutor/cwd Del | | @@ -18,9 +15,12 @@ | | | +| nm /tmp/pardes-snap/tutor/cwd Del +| +| +| | | -| nm /tmp/pardes-snap/tutor/cwd Del | | | diff --git a/test/snapshots/windowops.golden b/test/snapshots/windowops.golden index 061ceca9..5357ac7a 100644 --- a/test/snapshots/windowops.golden +++ b/test/snapshots/windowops.golden @@ -215,7 +215,7 @@ | | | -== snap altn grid=100x30 cursor=4,23 +== snap altn grid=100x30 cursor=4,19 |Kill Newcol Tutor Debug Colors NextColor Dump | nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del | @@ -224,21 +224,21 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del | -| w.txt | | | +| nm /tmp/pardes-snap/windowops/cwd Del | +| w.txt | +| nm /tmp/pardes-snap/windowops/cwd Del | +| w.txt | | | -| nm /tmp/pardes-snap/windowops/cwd Del | -| w.txt | | | @@ -246,7 +246,7 @@ | | | -== snap focus-left grid=100x30 cursor=4,23 +== snap focus-left grid=100x30 cursor=4,19 |Kill Newcol Tutor Debug Colors NextColor Dump | nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del | @@ -255,21 +255,21 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del | -| w.txt | | | +| nm /tmp/pardes-snap/windowops/cwd Del | +| w.txt | +| nm /tmp/pardes-snap/windowops/cwd Del | +| w.txt | | | -| nm /tmp/pardes-snap/windowops/cwd Del | -| w.txt | | | @@ -277,30 +277,30 @@ | | | -== snap debug-on grid=100x30 cursor=4,23 +== snap debug-on grid=100x30 cursor=4,19 |Kill Newcol Tutor Debug Colors NextColor Dump | nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowop╭────────────────────────────╮ | │pardes resizes=1 │ | w.txt w.txt │terms 4 cols 2 │ -| │active #3 38x9 │ -| │scroll 0/9 │ +| │active #3 38x13 │ +| │scroll 0/13 │ | │pinch 1.0000 │ | │tscroll 0.0000 │ -| nm /tmp/pardes-snap/windowops/cwd Del ╰────────────────────────────╯ -| -| w.txt +| ╰────────────────────────────╯ | | | +| nm /tmp/pardes-snap/windowops/cwd Del | +| w.txt | +| nm /tmp/pardes-snap/windowops/cwd Del | +| w.txt | | | -| nm /tmp/pardes-snap/windowops/cwd Del | -| w.txt | | | @@ -313,23 +313,23 @@ |1: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-39 d,#2c2a3e, 40-41 d,#383c54, 42-69 #969696,#2c2a3e, 70-99 d,d, |2: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-87 #969696,d, 88-98 d,#2a2a2a, 99-99 d,d, |3: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-85 #969696,d, 86-98 d,#2a2a2a, 99-99 d,d, -|4: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-85 #969696,d, 86-98 d,#2a2a2a, 99-99 d,d, -|5: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-80 #969696,d, 81-98 d,#2a2a2a, 99-99 d,d, +|4: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-86 #969696,d, 87-98 d,#2a2a2a, 99-99 d,d, +|5: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-81 #969696,d, 82-98 d,#2a2a2a, 99-99 d,d, |6: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-83 #969696,d, 84-98 d,#2a2a2a, 99-99 d,d, |7: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-70 d,d, 71-85 #969696,d, 86-98 d,#2a2a2a, 99-99 d,d, -|8: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-39 d,#2c2a3e, 40-41 d,#525252, 42-99 d,d, +|8: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |9: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |10: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |11: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, -|12: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, +|12: 0-1 d,#383c54, 2-38 #969696,#2c2a3e, 39-39 d,#2c2a3e, 40-41 d,#525252, 42-99 d,d, |13: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |14: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |15: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, -|16: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, +|16: 0-1 d,#6e4fd0, 2-38 #969696,#2c2a3e, 39-39 d,#2c2a3e, 40-41 d,#525252, 42-99 d,d, |17: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |18: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |19: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, -|20: 0-1 d,#6e4fd0, 2-38 #969696,#2c2a3e, 39-39 d,#2c2a3e, 40-41 d,#525252, 42-99 d,d, +|20: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |21: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |22: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |23: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, @@ -339,7 +339,7 @@ |27: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |28: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, |29: 0-1 d,#525252, 2-39 d,d, 40-41 d,#525252, 42-99 d,d, -== snap debug-off grid=100x30 cursor=4,23 +== snap debug-off grid=100x30 cursor=4,19 |Kill Newcol Tutor Debug Colors NextColor Dump | nm /tmp/pardes-snap/windowops/cwd Del nm /tmp/pardes-snap/windowops/cwd Del | @@ -348,21 +348,21 @@ | | | -| nm /tmp/pardes-snap/windowops/cwd Del | -| w.txt | | | +| nm /tmp/pardes-snap/windowops/cwd Del | +| w.txt | +| nm /tmp/pardes-snap/windowops/cwd Del | +| w.txt | | | -| nm /tmp/pardes-snap/windowops/cwd Del | -| w.txt | | | -- cgit v1.3 From a9bc331ab74f12b6b11fa6578d829d0da50ed636 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 6 Jul 2026 13:09:16 -0300 Subject: fix drag-select release crash: the 64-slot effect ring overflowed when one update emitted a big selection exec (emitWrite 64-byte chunks + padOutputBelowEdits CRs) and the emit assert panicked. Effects queue is now a growable ArrayList FIFO (payloads stay inline values); guard the two other Buf(256) asserts reachable from look (spawn cwd >256 -> error.PathTooLong in newShell, >256-char url skipped). New snap exec-bigdrag: giant middle-drag exec on a 60x200 grid, panicked before, alive-marker golden after. --- src/pardes.zig | 22 +++++++++----- test/snapshots/exec-bigdrag.golden | 61 ++++++++++++++++++++++++++++++++++++++ test/snapshots/exec-bigdrag.snap | 40 +++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 test/snapshots/exec-bigdrag.golden create mode 100644 test/snapshots/exec-bigdrag.snap (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index c4893b25..d617e552 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -628,9 +628,11 @@ pub const Pardes = struct { /// press during an active middle select-drag; consumed on middle release chord_arg: ?[]u8 = null, - effects: [64]Effect = undefined, + /// pending effects, drained by the shell after each update. Growable: one + /// update can emit unbounded writes (a big selection executed is chunked + /// into 64-byte write effects) — a fixed ring overflows and panics. + effects: std.ArrayList(Effect) = .empty, effects_head: usize = 0, - effects_tail: usize = 0, /// modal yank register (gpa-owned); a yank also mirrors out to the system /// clipboard via the set_clipboard effect. @@ -678,6 +680,7 @@ pub const Pardes = struct { if (p.yank) |y| gpa.free(y); if (p.dump_out) |d| gpa.free(d); if (p.chord_arg) |a| gpa.free(a); + p.effects.deinit(gpa); p.scratch.deinit(); gpa.free(p.surface.cells); gpa.destroy(p); @@ -717,6 +720,7 @@ pub const Pardes = struct { fn newShell(p: *Pardes, id: usize, cwd: []const u8) !*Pane { std.debug.assert(p.panes[id] == null); + if (cwd.len > 256) return error.PathTooLong; // spawn effect cwd is a Buf(256) const pane = try p.gpa.create(Pane); pane.* = .{ .vt = try ghostty_vt.Terminal.init(p.gpa, .{ @@ -780,14 +784,16 @@ pub const Pardes = struct { } fn emit(p: *Pardes, e: Effect) void { - std.debug.assert(p.effects_tail - p.effects_head < p.effects.len); - p.effects[p.effects_tail % p.effects.len] = e; - p.effects_tail += 1; + p.effects.append(p.gpa, e) catch {}; } pub fn nextEffect(p: *Pardes) ?Effect { - if (p.effects_head == p.effects_tail) return null; - const e = p.effects[p.effects_head % p.effects.len]; + if (p.effects_head == p.effects.items.len) { + p.effects.clearRetainingCapacity(); + p.effects_head = 0; + return null; + } + const e = p.effects.items[p.effects_head]; p.effects_head += 1; return e; } @@ -2607,7 +2613,7 @@ pub const Pardes = struct { }; switch (look.resolve(txt, cwd, &realbuf)) { .none => {}, - .url => |u| p.emit(.{ .open_link = .from(u) }), + .url => |u| if (u.len <= 256) p.emit(.{ .open_link = .from(u) }), .dir => |dir| { // focus an existing terminal on this dir, else fork one below for (p.panes, 0..) |slot, i| { diff --git a/test/snapshots/exec-bigdrag.golden b/test/snapshots/exec-bigdrag.golden new file mode 100644 index 00000000..613bb342 --- /dev/null +++ b/test/snapshots/exec-bigdrag.golden @@ -0,0 +1,61 @@ +== snap alive grid=200x60 cursor=104,37 +|Kill Newcol Tutor Debug Colors NextColor Dump +| nm /tmp/pardes-snap/exec-bigdrag/cwd Del nm /tmp/pardes-snap/exec-bigdrag/cwd Del +| bash: line: command not found +| big.txt +| bash: 4line: command not found +| +| bash: 15line: command not found +| +| bash: 726line: command not found +| +| bash: 2737line: command not found +| +| bash: 2748line: command not found +| +| bash: e: command not found +| +| bash: ne: command not found +| +| bash: ine: command not found +| +| bash: line: command not found +| +| bash: 2line: command not found +| +| bash: 13line: command not found +| +| bash: 824line: command not found +| +| bash: 2835line: command not found +| +| bash: 2846line: command not found +| nm /tmp/pardes-snap/exec-bigdrag/cwd Del +| bash: e: command not found +| big.txt +| bash: ne: command not found +| +| bash: ine: command not found +| echo alive-o''k +| bash: line: command not found +| +| bash: 0line: command not found +| +| bash: 11line: command not found +| +| bash: 922line: command not found +| +| bash: 2933line: command not found +| +| bash: 2944line: command not found +| +| bash: e: command not found +| +| bash: ne: command not found +| +| bash: ine: command not found +| +| bash: line: command not found +| +| alive-ok +| diff --git a/test/snapshots/exec-bigdrag.snap b/test/snapshots/exec-bigdrag.snap new file mode 100644 index 00000000..dae92205 --- /dev/null +++ b/test/snapshots/exec-bigdrag.snap @@ -0,0 +1,40 @@ +# a giant accidental middle-drag: the whole selection is executed, chunked +# into 64-byte write effects in ONE update — this used to burst the fixed +# 64-slot effect ring and panic the core (assert in emit). Needs a big grid: +# the selection must exceed 64*64 bytes, more than any 30x100 pane can hold. +lines big.txt 3000 +start 60 200 +wait 8000 big.txt +stable 500 20000 +press left 105 8 +release left 105 8 +stable 300 5000 +key i +text tr -d '\n' < big.txt +key esc +settle 400 +press middle 105 8 +drag middle 126 8 +release middle 126 8 +stable 800 30000 +# the accidental sweep over the full-height right pane, then release +press middle 105 4 +drag middle 150 30 +drag middle 198 58 +release middle 198 58 +settle 500 +stable 800 30000 +# still alive: type and execute a marker command +press left 105 40 +release left 105 40 +stable 300 5000 +key i +text echo alive-o''k +key esc +settle 300 +press middle 105 40 +drag middle 119 40 +release middle 119 40 +wait 10000 alive-ok +stable 800 20000 +snap alive -- cgit v1.3