diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-05 15:57:48 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-10 09:17:07 -0300 |
| commit | 1891a51ed2b64eec3964d3af3807be90d08a14c2 (patch) | |
| tree | 1f8e3afb3d2e765ade98ca8f41b3a416db396d24 /test | |
| parent | 68d208e1a0ff37eaef4a2a97b04797a1a6df277c (diff) | |
| download | pardes-1891a51ed2b64eec3964d3af3807be90d08a14c2.tar.gz pardes-1891a51ed2b64eec3964d3af3807be90d08a14c2.zip | |
soft-wrap long lines behind a toggle
Diffstat (limited to 'test')
| -rw-r--r-- | test/snapshots/builtins.golden | 44 | ||||
| -rw-r--r-- | test/snapshots/leader.golden | 6 | ||||
| -rw-r--r-- | test/snapshots/wrap.golden | 90 | ||||
| -rw-r--r-- | test/snapshots/wrap.snap | 54 |
4 files changed, 169 insertions, 25 deletions
diff --git a/test/snapshots/builtins.golden b/test/snapshots/builtins.golden index 8bb8d035..36a7b2d9 100644 --- a/test/snapshots/builtins.golden +++ b/test/snapshots/builtins.golden @@ -153,7 +153,6 @@ | | | /tmp/pardes-snap/builtins/cwd/+Help New Del -| 23 SPC l h SelectRefs | 24 SPC l i Lspinfo | 25 SPC l k Hover | 26 SPC l r Rename @@ -171,16 +170,17 @@ | 38 SPC t r Crt | 39 SPC t s PdfSections | 40 SPC t t ThemeSel -| 41 SPC t z PdfFit -| 42 SPC w h Left C-w h, C-w left -| 43 SPC w j Down C-w j, C-w down -| 44 SPC w k Up C-w k, C-w up -| 45 SPC w l Right C-w l, C-w right -| 46 SPC w t Toggleterm -| 47 Look enter, right-click -| 48 Exec tab, middle-click -| 49 Theme -| 50 +| 41 SPC t w Wrap +| 42 SPC t z PdfFit +| 43 SPC w h Left C-w h, C-w left +| 44 SPC w j Down C-w j, C-w down +| 45 SPC w k Up C-w k, C-w up +| 46 SPC w l Right C-w l, C-w right +| 47 SPC w t Toggleterm +| 48 Look enter, right-click +| 49 Exec tab, middle-click +| 50 Theme +| 51 == snap not-a-picker grid=120x60 cursor=7,58 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill | /tmp/pardes-snap/builtins/cwd/notes.txt Save New Del @@ -214,7 +214,6 @@ | | | /tmp/pardes-snap/builtins/cwd/+Help New Del -| 23 SPC l h SelectRefs | 24 SPC l i Lspinfo | 25 SPC l k Hover | 26 SPC l r Rename @@ -232,16 +231,17 @@ | 38 SPC t r Crt | 39 SPC t s PdfSections | 40 SPC t t ThemeSel -| 41 SPC t z PdfFit -| 42 SPC w h Left C-w h, C-w left -| 43 SPC w j Down C-w j, C-w down -| 44 SPC w k Up C-w k, C-w up -| 45 SPC w l Right C-w l, C-w right -| 46 SPC w t Toggleterm -| 47 Look enter, right-click -| 48 Exec tab, middle-click -| 49 Theme -| 50 +| 41 SPC t w Wrap +| 42 SPC t z PdfFit +| 43 SPC w h Left C-w h, C-w left +| 44 SPC w j Down C-w j, C-w down +| 45 SPC w k Up C-w k, C-w up +| 46 SPC w l Right C-w l, C-w right +| 47 SPC w t Toggleterm +| 48 Look enter, right-click +| 49 Exec tab, middle-click +| 50 Theme +| 51 == snap window-group grid=120x60 cursor=7,32 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill | /tmp/pardes-snap/builtins/cwd/notes.txt Save New Del diff --git a/test/snapshots/leader.golden b/test/snapshots/leader.golden index db443b80..c33b1633 100644 --- a/test/snapshots/leader.golden +++ b/test/snapshots/leader.golden @@ -402,9 +402,9 @@ | 10 SPC t r Crt | 11 SPC t s PdfSections | 12 SPC t t ThemeSel -| 13 SPC t z PdfFit -| 14 -| +| 13 SPC t w Wrap +| 14 SPC t z PdfFit +| 15 | | | diff --git a/test/snapshots/wrap.golden b/test/snapshots/wrap.golden new file mode 100644 index 00000000..87b70f68 --- /dev/null +++ b/test/snapshots/wrap.golden @@ -0,0 +1,90 @@ +== snap off grid=47x14 cursor=7,2 +|New Newcol Find Grep Help Tutor Dump NextColor +| /tmp/pardes-snap/wrap/cwd/long.txt Save New D +| 1 0---------1---------2---------3--------- +| 2 second line +| 3 third line +| 4 +| +| +| +| +| +| +| +| +== snap on-narrow grid=47x14 cursor=7,2 +|New Newcol Find Grep Help Tutor Dump NextColor +| /tmp/pardes-snap/wrap/cwd/long.txt Save New D +| 1 0---------1---------2---------3--------- +| 4---------5---------6---------7--------- +| 8---------9---------A---------B--------- +| C---------D---------E---------F--------- +| G---------H---------I---------J--------- +| 2 second line +| 3 third line +| 4 +| +| +| +| +== snap clicked grid=47x14 cursor=17,3 +|New Newcol Find Grep Help Tutor Dump NextColor +| /tmp/pardes-snap/wrap/cwd/long.txt Save New D +| 1 0---------1---------2---------3--------- +| 4---------5---------6---------7--------- +| 8---------9---------A---------B--------- +| C---------D---------E---------F--------- +| G---------H---------I---------J--------- +| 2 second line +| 3 third line +| 4 +| +| +| +| +== snap logical-j grid=47x14 cursor=18,7 +|New Newcol Find Grep Help Tutor Dump NextColor +| /tmp/pardes-snap/wrap/cwd/long.txt Save New D +| 1 0---------1---------2---------3--------- +| 4---------5---------6---------7--------- +| 8---------9---------A---------B--------- +| C---------D---------E---------F--------- +| G---------H---------I---------J--------- +| 2 second line +| 3 third line +| 4 +| +| +| +| +== snap off-again grid=47x14 cursor=18,3 +|New Newcol Find Grep Help Tutor Dump NextColor +| /tmp/pardes-snap/wrap/cwd/long.txt Save New D +| 1 0---------1---------2---------3--------- +| 2 second line +| 3 third line +| 4 +| +| +| +| +| +| +| +| +== snap on-wide grid=127x14 cursor=7,2 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +| /tmp/pardes-snap/wrap/cwd/long.txt Save New Del +| 1 0---------1---------2---------3---------4---------5---------6---------7---------8---------9--------- +| A---------B---------C---------D---------E---------F---------G---------H---------I---------J--------- +| 2 second line +| 3 third line +| 4 +| +| +| +| +| +| +| diff --git a/test/snapshots/wrap.snap b/test/snapshots/wrap.snap new file mode 100644 index 00000000..c6e976b1 --- /dev/null +++ b/test/snapshots/wrap.snap @@ -0,0 +1,54 @@ +# Soft line breaks (the Wrap builtin, `SPC t w`): a file line too long for the +# pane renders across several body rows instead of running off the right edge. +# OFF by default, and off it is the clipping render it has always been. +# +# Three rules pinned here. The break is at min(100, the pane's own content +# width), so a narrow pane breaks at its own edge and a wide one stops at 100. +# A continuation row carries a BLANK gutter — the number belongs to the LINE, +# and a number repeated down a wrapped line would read as several lines. And +# the mouse follows the render: a click on a continuation row lands on the +# character under the pointer, which only works if the click resolves through +# the same row->line map the body was drawn from. +# +# The line is 20 decades, each headed by its own column marker: `0` at column +# 0, `4` at 40, `A` at 100. So the first character of a continuation row NAMES +# the column it broke at, and the width rule is readable straight off the grid. +file long.txt 0---------1---------2---------3---------4---------5---------6---------7---------8---------9---------A---------B---------C---------D---------E---------F---------G---------H---------I---------J---------\nsecond line\nthird line\n +# 47 columns: the 2-column chrome gutter plus the 5-column line-number gutter +# leave 40 for content, under 100, so the PANE's width is the break. +start 14 47 long.txt +wait 8000 New Newcol +stable 700 20000 +# off: line 1 on ONE row, cut at the right edge, lines 2 and 3 under it +snap off +key space t w +stable 400 5000 +# on: five rows for line 1 (200 bytes / 40), the four continuations gutterless +# and starting at `4` `8` `C` `G` — the columns 40, 80, 120, 160 +snap on-narrow +# a click on the SECOND row of line 1, on the `5` marker at column 50. The +# cursor must come back to the cell that was clicked (grid 17,3): the click +# resolved to line 1 column 50, and the render put line 1 column 50 back where +# the finger was. Off by one row and it would land in line 2 instead. +press left 18 4 +release left 18 4 +stable 400 5000 +snap clicked +# motions stay LOGICAL: one `j` from line 1 leaves the whole wrapped line +# behind and lands on line 2, four screen rows down at once. +key j +stable 400 5000 +snap logical-j +# ...and off again is off: the same clipped body as the first snap, because +# the map the readers consult goes back to empty and every one of them falls +# back to the row arithmetic it used before any of this existed +key space t w +stable 400 5000 +snap off-again +# 127 columns: 120 for content, so the 100 wins and the break is at the `A` +start 14 127 long.txt +wait 8000 New Newcol +stable 700 20000 +key space t w +stable 400 5000 +snap on-wide |
