summaryrefslogtreecommitdiff
path: root/test/hxcases/cases.jsonl
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-31 05:04:26 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:08 -0300
commit5bf8d6dd077517270377e5d8551108ecf252374f (patch)
treec7783fa9fc133980d3d6fff0129e8de5a1b43601 /test/hxcases/cases.jsonl
parenteefac04995ffad847a4098f16d2e82ccab16438b (diff)
downloadpardes-5bf8d6dd077517270377e5d8551108ecf252374f.tar.gz
pardes-5bf8d6dd077517270377e5d8551108ecf252374f.zip
multiple cursors, regex selection, and Ctrl-c comments
The primary cursor stays exactly where it was — cur_row/cur_col plus vsel — and sels[] holds helix's OTHER ranges. That split is why nothing moved at one cursor: with nsel == 0 not one line of the existing motion, operator, render or mouse code takes a different branch, which is what protects 800 differential cases and 67 goldens. paneRanges/setPaneRanges are the whole list; setPaneRanges IS helix's Selection::new (min width 1, sorted, overlaps merged, primary follows its range through a merge). An ordinary key runs the single-selection handler once per range, visited last-first so an edit never disturbs a range still waiting, and each finished pass is remembered as a distance from the END of the text, which an earlier edit cannot move — helix's change mapping without a change map. pushUndo fires once per keystroke, yanks accumulate, and a builtin acts from the primary and stops the replay, which also closes the use-after-free window if it frees the pane. s and S reuse the / prompt wholesale rather than growing a second one: the pattern is typed into the tag tail, and every keystroke re-runs the match from the selection the prompt opened on, so the preview is live and Esc is just the empty pattern. mvzr does runtime patterns — a bytecode VM in a fixed-size struct with no allocator — with 64 ops and 8 char classes per pattern, no case-insensitive flag (helix's smart case is done by folding a scratch copy), no captures, no multi-line anchors. The last two are the two waivers. Ctrl-c is a whole-list key and not a per-cursor replay, because helix decides comment-vs-uncomment ONCE for the whole selection; replaying it would take that decision n times. Comment tokens are a table in config.zig keyed on the same extension syntax.zig picks grammars by. Found and fixed a pre-existing single-cursor bug on the way: la<bs><esc> left the cursor one cell before where the append began. helix's restore_cursor can never walk past the origin; ours backed up unconditionally. hxdiff was green before AND after — the old one-selection contract could not see it. hxdiff 360 -> 481 cases, hxparity 440 -> 561, all goldens from real helix; the harness contract now reports every range and its primary, omitted when there is one, so 359 of the 360 old goldens are byte-identical. The one that moved is o-count: helix's 2o really does leave two cursors and could not say so before.
Diffstat (limited to 'test/hxcases/cases.jsonl')
-rw-r--r--test/hxcases/cases.jsonl121
1 files changed, 121 insertions, 0 deletions
diff --git a/test/hxcases/cases.jsonl b/test/hxcases/cases.jsonl
index 386013bf..b0a3aad4 100644
--- a/test/hxcases/cases.jsonl
+++ b/test/hxcases/cases.jsonl
@@ -358,3 +358,124 @@
{"name": "ins-arrows", "pane": "file", "text": "abc\ndef\n", "keys": "i<down><right>x<esc>"}
{"name": "ins-tab-col0", "pane": "file", "text": "ab\n", "keys": "i<tab><esc>"}
{"name": "ins-tab-mid", "pane": "file", "text": "ab\n", "keys": "li<tab><esc>"}
+{"name": "msel-C-basic", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "lC"}
+{"name": "msel-C-basic-tty", "pane": "tty", "text": "aaa\nbbb\nccc\n", "keys": "lC"}
+{"name": "msel-C-count", "pane": "file", "text": "aaa\nbbb\nccc\nddd\n", "keys": "2C"}
+{"name": "msel-C-count-tty", "pane": "tty", "text": "aaa\nbbb\nccc\nddd\n", "keys": "2C"}
+{"name": "msel-C-skips-short", "pane": "file", "text": "abcdef\nab\nabcdef\n", "keys": "4lC"}
+{"name": "msel-C-stops-at-eof", "pane": "file", "text": "aa\nbb\n", "keys": "CCC"}
+{"name": "msel-C-of-selection", "pane": "file", "text": "abcd\nabcd\nabcd\n", "keys": "vllC"}
+{"name": "msel-C-above", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "jjl<A-C>"}
+{"name": "msel-C-above-tty", "pane": "tty", "text": "aaa\nbbb\nccc\n", "keys": "jjl<A-C>"}
+{"name": "msel-C-above-at-top", "pane": "file", "text": "aaa\nbbb\n", "keys": "<A-C>"}
+{"name": "msel-C-empty-line", "pane": "file", "text": "ab\n\ncd\n", "keys": "C"}
+{"name": "msel-move-l", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "Cl"}
+{"name": "msel-move-l-tty", "pane": "tty", "text": "aaa\nbbb\nccc\n", "keys": "Cl"}
+{"name": "msel-move-jj", "pane": "file", "text": "aaaa\nbbbb\ncccc\ndddd\n", "keys": "2lCkk"}
+{"name": "msel-word", "pane": "file", "text": "one two\nsix seven\n", "keys": "Cw"}
+{"name": "msel-goto-line-end", "pane": "file", "text": "aaa\nbbbbb\n", "keys": "Cgl"}
+{"name": "msel-keep-primary", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "CC,"}
+{"name": "msel-keep-primary-tty", "pane": "tty", "text": "aaa\nbbb\nccc\n", "keys": "CC,"}
+{"name": "msel-remove-primary", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "CC<A-,>"}
+{"name": "msel-remove-primary-last", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "CC)<A-,>"}
+{"name": "msel-rotate-fwd", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "CC)"}
+{"name": "msel-rotate-fwd-tty", "pane": "tty", "text": "aaa\nbbb\nccc\n", "keys": "CC)"}
+{"name": "msel-rotate-back", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "CC("}
+{"name": "msel-rotate-wrap", "pane": "file", "text": "aaa\nbbb\n", "keys": "C))"}
+{"name": "msel-split-newline", "pane": "file", "text": "aa\nbb\ncc\n", "keys": "%<A-s>"}
+{"name": "msel-split-partial", "pane": "file", "text": "abcd\nefgh\n", "keys": "vjl<A-s>"}
+{"name": "msel-split-partial-tty", "pane": "tty", "text": "abcd\nefgh\n", "keys": "vjl<A-s>"}
+{"name": "msel-merge", "pane": "file", "text": "aaa\nbbb\nccc\n", "keys": "CC<A-minus>"}
+{"name": "msel-merge-consecutive", "pane": "file", "text": "aa\nbb\ncc\n", "keys": "xC<A-_>"}
+{"name": "msel-trim", "pane": "file", "text": " ab \n", "keys": "%_"}
+{"name": "msel-trim-all-ws", "pane": "file", "text": " \n", "keys": "%_"}
+{"name": "msel-trim-multi", "pane": "file", "text": " ab \n cd \n", "keys": "x<A-x>C_"}
+{"name": "msel-insert", "pane": "file", "text": "aa\nbb\n", "keys": "Cix<esc>"}
+{"name": "msel-insert-tty", "pane": "tty", "text": "aa\nbb\n", "keys": "Cix<esc>"}
+{"name": "msel-append", "pane": "file", "text": "aa\nbb\n", "keys": "Caz<esc>"}
+{"name": "msel-insert-two-chars", "pane": "file", "text": "aa\nbb\ncc\n", "keys": "2Cixy<esc>"}
+{"name": "msel-delete", "pane": "file", "text": "abc\nabc\n", "keys": "Cd"}
+{"name": "msel-delete-tty", "pane": "tty", "text": "abc\nabc\n", "keys": "Cd"}
+{"name": "msel-delete-selection", "pane": "file", "text": "abcd\nabcd\n", "keys": "vlCd"}
+{"name": "msel-change", "pane": "file", "text": "abc\nabc\n", "keys": "Ccz<esc>"}
+{"name": "msel-switch-case", "pane": "file", "text": "abc\nabc\n", "keys": "C~"}
+{"name": "msel-switch-case-tty", "pane": "tty", "text": "abc\nabc\n", "keys": "C~"}
+{"name": "msel-uppercase", "pane": "file", "text": "abc\nabc\n", "keys": "vlC<A-`>"}
+{"name": "msel-indent", "pane": "file", "text": "aa\nbb\n", "keys": "C<gt>"}
+{"name": "msel-replace-char", "pane": "file", "text": "abc\nabc\n", "keys": "Crz"}
+{"name": "msel-undo", "pane": "file", "text": "abc\nabc\n", "keys": "Cdu"}
+{"name": "msel-open-below", "pane": "file", "text": "aa\nbb\n", "keys": "Coz<esc>"}
+{"name": "msel-line-select", "pane": "file", "text": "aa\nbb\ncc\n", "keys": "Cx"}
+{"name": "msel-collapse", "pane": "file", "text": "abcd\nabcd\n", "keys": "vllC;"}
+{"name": "msel-flip", "pane": "file", "text": "abcd\nabcd\n", "keys": "vllC<A-;>"}
+{"name": "msel-yank-paste", "pane": "file", "text": "ab\ncd\n", "keys": "Cyp"}
+{"name": "msel-esc-keeps", "pane": "file", "text": "aa\nbb\n", "keys": "C<esc>"}
+{"name": "msel-select-mode", "pane": "file", "text": "abcd\nabcd\n", "keys": "Cvl"}
+{"name": "msel-open-count", "pane": "file", "text": "ab\n", "keys": "2O"}
+{"name": "msel-backspace", "pane": "file", "text": "abc\nabc\n", "keys": "Cla<backspace><esc>"}
+{"name": "msel-backspace-tty", "pane": "tty", "text": "abc\nabc\n", "keys": "Cla<backspace><esc>"}
+{"name": "sel-regex-basic", "pane": "file", "text": "alpha beta alpha\n", "keys": "%sa<ret>"}
+{"name": "sel-regex-basic-tty", "pane": "tty", "text": "alpha beta alpha\n", "keys": "%sa<ret>"}
+{"name": "sel-regex-word", "pane": "file", "text": "alpha beta alpha\n", "keys": "%salpha<ret>"}
+{"name": "sel-regex-class", "pane": "file", "text": "a1b22c333\n", "keys": "%s[0-9]+<ret>"}
+{"name": "sel-regex-class-tty", "pane": "tty", "text": "a1b22c333\n", "keys": "%s[0-9]+<ret>"}
+{"name": "sel-regex-alt", "pane": "file", "text": "cat dog cat\n", "keys": "%scat|dog<ret>"}
+{"name": "sel-regex-plus", "pane": "file", "text": "aa b aaa\n", "keys": "%sa+<ret>"}
+{"name": "sel-regex-star-empty", "pane": "file", "text": "ab\n", "keys": "%sx*<ret>"}
+{"name": "sel-regex-nomatch", "pane": "file", "text": "alpha beta\n", "keys": "%szzz<ret>"}
+{"name": "sel-regex-esc", "pane": "file", "text": "alpha beta alpha\n", "keys": "%sa<esc>"}
+{"name": "sel-regex-empty", "pane": "file", "text": "abc\n", "keys": "%s<ret>"}
+{"name": "sel-regex-invalid", "pane": "file", "text": "abc\n", "keys": "%s[<ret>"}
+{"name": "sel-regex-within-sels", "pane": "file", "text": "aXa\nbXb\n", "keys": "xxsX<ret>"}
+{"name": "sel-regex-within-sels-tty", "pane": "tty", "text": "aXa\nbXb\n", "keys": "xxsX<ret>"}
+{"name": "sel-regex-at-cursors", "pane": "file", "text": "foo bar\nfoo baz\n", "keys": "xxsfoo<ret>"}
+{"name": "sel-regex-narrow", "pane": "file", "text": "alpha beta alpha\n", "keys": "%salpha<ret>sa<ret>"}
+{"name": "sel-regex-select-mode", "pane": "file", "text": "alpha beta\n", "keys": "v5lsa<ret>"}
+{"name": "sel-regex-multiline", "pane": "file", "text": "one\ntwo\nthree\n", "keys": "%so<ret>"}
+{"name": "sel-regex-smart-case", "pane": "file", "text": "Alpha alpha ALPHA\n", "keys": "%salpha<ret>"}
+{"name": "sel-regex-cased", "pane": "file", "text": "Alpha alpha ALPHA\n", "keys": "%sAlpha<ret>"}
+{"name": "sel-regex-boundary", "pane": "file", "text": "cat cats\n", "keys": "%s\\bcat\\b<ret>"}
+{"name": "sel-regex-whole", "pane": "file", "text": "abc\n", "keys": "%sabc<ret>"}
+{"name": "sel-regex-then-motion", "pane": "file", "text": "foo bar foo baz\n", "keys": "%sfoo<ret>w"}
+{"name": "sel-regex-then-delete", "pane": "file", "text": "a1b2c3\n", "keys": "%s[0-9]<ret>d"}
+{"name": "sel-regex-dot-newline", "pane": "file", "text": "ab\n", "keys": "%s.<ret>"}
+{"name": "sel-regex-caret", "pane": "file", "text": "ab\nab\n", "keys": "%s^a<ret>"}
+{"name": "split-regex-comma", "pane": "file", "text": "a,b,c\n", "keys": "%S,<ret>"}
+{"name": "split-regex-comma-tty", "pane": "tty", "text": "a,b,c\n", "keys": "%S,<ret>"}
+{"name": "split-regex-lead", "pane": "file", "text": ",a,b\n", "keys": "%S,<ret>"}
+{"name": "split-regex-trail", "pane": "file", "text": "a,b,\n", "keys": "%S,<ret>"}
+{"name": "split-regex-adjacent", "pane": "file", "text": "a,,b\n", "keys": "%S,<ret>"}
+{"name": "split-regex-ws", "pane": "file", "text": "one two three\n", "keys": "%S\\s+<ret>"}
+{"name": "split-regex-ws-tty", "pane": "tty", "text": "one two three\n", "keys": "%S\\s+<ret>"}
+{"name": "split-regex-nomatch", "pane": "file", "text": "abc\n", "keys": "%Sz<ret>"}
+{"name": "split-regex-newline", "pane": "file", "text": "one\ntwo\nthree\n", "keys": "%S\\n<ret>"}
+{"name": "split-regex-esc", "pane": "file", "text": "a,b,c\n", "keys": "%S,<esc>"}
+{"name": "split-regex-within-sels", "pane": "file", "text": "aXa\nbXb\n", "keys": "xxSX<ret>"}
+{"name": "split-regex-end", "pane": "file", "text": "abc\n", "keys": "%Sc<ret>"}
+{"name": "comment-line", "pane": "file", "text": "alpha\nbeta\n", "keys": "<C-c>"}
+{"name": "comment-toggle-back", "pane": "file", "text": "alpha\nbeta\n", "keys": "<C-c><C-c>"}
+{"name": "comment-selection", "pane": "file", "text": "alpha\nbeta\ngamma\n", "keys": "xx<C-c>"}
+{"name": "comment-indent", "pane": "file", "text": " alpha\n beta\n", "keys": "%<C-c>"}
+{"name": "comment-indent-round-trip", "pane": "file", "text": " alpha\n beta\n", "keys": "%<C-c>%<C-c>"}
+{"name": "comment-blank-skipped", "pane": "file", "text": "alpha\n\nbeta\n", "keys": "%<C-c>"}
+{"name": "comment-partial", "pane": "file", "text": "# alpha\nbeta\ngamma\n", "keys": "%<C-c>"}
+{"name": "comment-uncomment", "pane": "file", "text": "# alpha\n# beta\n", "keys": "%<C-c>"}
+{"name": "comment-margin0", "pane": "file", "text": "#alpha\n# beta\n", "keys": "%<C-c>"}
+{"name": "comment-token-only", "pane": "file", "text": "#\n#\n", "keys": "%<C-c>"}
+{"name": "comment-uncomment-deep", "pane": "file", "text": "# alpha\n # beta\n", "keys": "%<C-c>"}
+{"name": "comment-tab-indent", "pane": "file", "text": "\talpha\n\tbeta\n", "keys": "%<C-c>"}
+{"name": "comment-other-token", "pane": "file", "text": "// alpha\n// beta\n", "keys": "%<C-c>"}
+{"name": "comment-noeol", "pane": "file", "text": "alpha", "keys": "<C-c>"}
+{"name": "comment-empty", "pane": "file", "text": "\n", "keys": "<C-c>"}
+{"name": "comment-only-blank", "pane": "file", "text": " \n\t\n", "keys": "%<C-c>"}
+{"name": "comment-select-mode", "pane": "file", "text": "alpha\nbeta\n", "keys": "vj<C-c>"}
+{"name": "comment-count-ignored", "pane": "file", "text": "alpha\nbeta\ngamma\n", "keys": "3<C-c>"}
+{"name": "comment-undo", "pane": "file", "text": "alpha\nbeta\n", "keys": "%<C-c>u"}
+{"name": "comment-multi-cursor", "pane": "file", "text": "alpha\nbeta\ngamma\n", "keys": "C<C-c>"}
+{"name": "comment-same-line-cursors", "pane": "file", "text": "alpha beta\n", "keys": "wC<C-c>"}
+{"name": "comment-cursor-gap", "pane": "file", "text": "a\nb\nc\nd\n", "keys": "2C<C-c>"}
+{"name": "comment-split-cursors", "pane": "file", "text": "alpha\nbeta\ngamma\n", "keys": "%<A-s><C-c>"}
+{"name": "comment-last-line", "pane": "file", "text": "alpha\nbeta\n", "keys": "jj<C-c>"}
+{"name": "comment-then-insert", "pane": "file", "text": "alpha\n", "keys": "<C-c>iz<esc>"}
+{"name": "comment-after-sel-regex", "pane": "file", "text": "alpha\nbeta\ngamma\n", "keys": "%sa<ret><C-c>"}
+{"name": "comment-after-split-regex", "pane": "file", "text": "a,b\nc,d\n", "keys": "%S,<ret><C-c>"}