diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 16:35:27 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | e87e16547a17864b2a0cd574c1aa42d44125bc6c (patch) | |
| tree | 45a35aec572bc141c008bc6c17c7a2d5acf6a653 /test | |
| parent | 79cdf76fd2dd0ba03622bfe742b525b770d51684 (diff) | |
| download | pardes-e87e16547a17864b2a0cd574c1aa42d44125bc6c.tar.gz pardes-e87e16547a17864b2a0cd574c1aa42d44125bc6c.zip | |
Alt-o, Alt-i and the other tree-sitter keys walk the file's syntax tree
helix's expand/shrink, previous/next sibling, all siblings, all children and
parent-node end/start (Alt-o/up, Alt-i/down, Alt-p/left, Alt-right, Alt-a,
Alt-I, Alt-e, Alt-b; Alt-n stays the new terminal) walk a whole-file parse
the file keeps (File.node_tree), made on the first such key after an edit and
reused until the next, never per key. syntax.walkNodes follows helix's
TreeCursor over every node, anonymous ones included, and Alt-i goes back to
what Alt-o grew from while the selection still holds it. The harness runs
without grammars, so the cases prove the plain-text no-op; a test replays
eleven JSON walks whose results were taken from the installed hx.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/hxcases/cases.jsonl | 1 | ||||
| -rw-r--r-- | test/hxcases/goldens.jsonl | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/test/hxcases/cases.jsonl b/test/hxcases/cases.jsonl index 43cbbf11..8a8f8a94 100644 --- a/test/hxcases/cases.jsonl +++ b/test/hxcases/cases.jsonl @@ -440,6 +440,7 @@ {"name": "keep-regex-lines", "pane": "file", "text": "foo\nbar\nbaz\n", "keys": "%<A-s>K^b<ret>"} {"name": "ensure-forward", "pane": "file", "text": "ab cd\n", "keys": "%s\\w+<ret><A-;><A-:>"} {"name": "ensure-forward-one", "pane": "file", "text": "abc\n", "keys": "vll<A-;><A-:>"} +{"name": "node-keys-plain-text", "pane": "file", "text": "ab cd\n", "keys": "w<A-o><A-i><A-p><A-right><A-a><A-I><A-e><A-b>"} {"name": "msel-align-basic", "pane": "file", "text": "a=1\nbbb=2\n", "keys": "%s=<ret>&"} {"name": "msel-align-columns", "pane": "file", "text": "a,b,c\nccc,d,e\n", "keys": "%s,<ret>&"} {"name": "msel-align-uneven", "pane": "file", "text": "a,b\nccc,d,eee,f\n", "keys": "%s,<ret>&"} diff --git a/test/hxcases/goldens.jsonl b/test/hxcases/goldens.jsonl index 9839335a..f1df5c0a 100644 --- a/test/hxcases/goldens.jsonl +++ b/test/hxcases/goldens.jsonl @@ -440,6 +440,7 @@ {"name":"keep-regex-lines","text":"foo\nbar\nbaz\n","mode":"normal","cursor":{"row":1,"col":2},"anchor":{"row":1,"col":0},"sels":[{"cursor":{"row":1,"col":2},"anchor":{"row":1,"col":0}},{"cursor":{"row":2,"col":2},"anchor":{"row":2,"col":0}}],"primary":0} {"name":"ensure-forward","text":"ab cd\n","mode":"normal","cursor":{"row":0,"col":1},"anchor":{"row":0,"col":0},"sels":[{"cursor":{"row":0,"col":1},"anchor":{"row":0,"col":0}},{"cursor":{"row":0,"col":4},"anchor":{"row":0,"col":3}}],"primary":0} {"name":"ensure-forward-one","text":"abc\n","mode":"select","cursor":{"row":0,"col":2},"anchor":{"row":0,"col":0}} +{"name":"node-keys-plain-text","text":"ab cd\n","mode":"normal","cursor":{"row":0,"col":2},"anchor":{"row":0,"col":0}} {"name":"msel-align-basic","text":"a =1\nbbb=2\n","mode":"normal","cursor":{"row":0,"col":3},"anchor":{"row":0,"col":3},"sels":[{"cursor":{"row":0,"col":3},"anchor":{"row":0,"col":3}},{"cursor":{"row":1,"col":3},"anchor":{"row":1,"col":3}}],"primary":0} {"name":"msel-align-columns","text":"a ,b,c\nccc,d,e\n","mode":"normal","cursor":{"row":0,"col":3},"anchor":{"row":0,"col":3},"sels":[{"cursor":{"row":0,"col":3},"anchor":{"row":0,"col":3}},{"cursor":{"row":0,"col":5},"anchor":{"row":0,"col":5}},{"cursor":{"row":1,"col":3},"anchor":{"row":1,"col":3}},{"cursor":{"row":1,"col":5},"anchor":{"row":1,"col":5}}],"primary":0} {"name":"msel-align-uneven","text":"a ,b\nccc,d,eee,f\n","mode":"normal","cursor":{"row":0,"col":3},"anchor":{"row":0,"col":3},"sels":[{"cursor":{"row":0,"col":3},"anchor":{"row":0,"col":3}},{"cursor":{"row":1,"col":3},"anchor":{"row":1,"col":3}},{"cursor":{"row":1,"col":5},"anchor":{"row":1,"col":5}},{"cursor":{"row":1,"col":9},"anchor":{"row":1,"col":9}}],"primary":0} |
