NS8 slice: Implement composable objects, selections, and delimiter matching #47

Closed
opened 2026-06-21 09:12:12 +00:00 by tmk241 · 1 comment
Owner

OBJECTIVE: Implement the KEYMAP.md object grammar so verbs compose with word/line/indent/parameter/enclosing-form/delimiter objects instead of one-off bindings.

AUTHORITY: Parent #43; KEYMAP.md Orthogonality rules, Object and match grammar; req: input/007, coding/001-005, testing/001-004.

AGENT AUTHORITY:

  • Delivery authority: local-commit
  • Tracker authority: this issue may be commented and closed when acceptance passes; parent #43 may be commented/checklisted.
  • Handoff state: committed clean, tracker commented/closed.

PARENT: #43 via explicit issue link and parent checklist.

SCOPE: Selection state, text-object parser, delimiter/quote matching for ()[]{} and sensible quotes, indent-block detection, parameter/object detection using syntax data when available with text fallback, verb-object dispatch for select/delete/change/yank. Likely files: input/session/tui plus syntax helpers.

BOUNDARIES: Do not create a full language parser if Tree-sitter/LSP data is unavailable; use safe textual fallbacks and clear unsupported diagnostics. Do not clone Vim text-object compatibility beyond KEYMAP.md intent.

ACCEPTANCE:

  • m m jumps to matching delimiter/quote; physical % is an alias where available.
  • m s and m a select inside/around the matched pair.
  • m (, m {, m [, and quote variants choose the requested pair type.
  • s w, s l, s i, s p, s f, and s d select word, line, indent block, parameter, enclosing form/function, and diagnostic range where available.
  • d, c, y, and s reuse the same object grammar; adding an object does not require duplicating each verb binding.
  • Unmatched delimiters, mixed quotes, tabs/spaces indentation, empty blocks, and file boundary cases produce predictable selections or diagnostics without corrupting text.

VERIFICATION:

  • zig build test
  • Fixture/replay tests for nested delimiters, quotes, escaped quotes, indent blocks with tabs/spaces, parameters, diagnostics, and verb-object composition.
  • zig build v1-smoke

BLOCKERS: none.

OBJECTIVE: Implement the KEYMAP.md object grammar so verbs compose with word/line/indent/parameter/enclosing-form/delimiter objects instead of one-off bindings. AUTHORITY: Parent #43; KEYMAP.md `Orthogonality rules`, `Object and match grammar`; req: input/007, coding/001-005, testing/001-004. AGENT AUTHORITY: - Delivery authority: local-commit - Tracker authority: this issue may be commented and closed when acceptance passes; parent #43 may be commented/checklisted. - Handoff state: committed clean, tracker commented/closed. PARENT: #43 via explicit issue link and parent checklist. SCOPE: Selection state, text-object parser, delimiter/quote matching for `()[]{}` and sensible quotes, indent-block detection, parameter/object detection using syntax data when available with text fallback, verb-object dispatch for select/delete/change/yank. Likely files: input/session/tui plus syntax helpers. BOUNDARIES: Do not create a full language parser if Tree-sitter/LSP data is unavailable; use safe textual fallbacks and clear unsupported diagnostics. Do not clone Vim text-object compatibility beyond KEYMAP.md intent. ACCEPTANCE: - `m m` jumps to matching delimiter/quote; physical `%` is an alias where available. - `m s` and `m a` select inside/around the matched pair. - `m (`, `m {`, `m [`, and quote variants choose the requested pair type. - `s w`, `s l`, `s i`, `s p`, `s f`, and `s d` select word, line, indent block, parameter, enclosing form/function, and diagnostic range where available. - `d`, `c`, `y`, and `s` reuse the same object grammar; adding an object does not require duplicating each verb binding. - Unmatched delimiters, mixed quotes, tabs/spaces indentation, empty blocks, and file boundary cases produce predictable selections or diagnostics without corrupting text. VERIFICATION: - `zig build test` - Fixture/replay tests for nested delimiters, quotes, escaped quotes, indent blocks with tabs/spaces, parameters, diagnostics, and verb-object composition. - `zig build v1-smoke` BLOCKERS: none.
tmk241 added the sliceready-for-agentgoal labels 2026-06-21 09:12:12 +00:00
Author
Owner

Completed in commit 30af1e9 (Add composable object selections).

What changed:

  • Added session range operations for byte-accurate selection, cursor movement to a byte, and range replacement.
  • Added shared TUI object grammar for w, l, i, p, f, and d objects.
  • Wired the same object ranges through Select mode and d/c/y operator rails, so delete/change/yank compose instead of duplicating per-verb logic.
  • Added delimiter/quote matching for m m, m s, m a, and explicit pair selectors such as m ( / m { / quotes, with escaped quote handling.
  • Added text fallbacks for indent blocks, parameter ranges, enclosing forms, and diagnostic-line selection.
  • Added adversarial unmatched-delimiter behavior that reports visibly without corrupting the buffer.

Verification:

  • zig fmt src/session.zig src/tui.zig && zig build test
  • zig build
  • zig build v1-smoke
  • zig build run -- --help
  • zig build run -- src/main.zig
  • redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md

Notes:

  • This closes the composable object/selection/delimiter slice. Rich syntax/LSP-backed object precision can improve later, but #47 now has working textual fallbacks and shared verb-object behavior.
Completed in commit 30af1e9 (`Add composable object selections`). What changed: - Added session range operations for byte-accurate selection, cursor movement to a byte, and range replacement. - Added shared TUI object grammar for `w`, `l`, `i`, `p`, `f`, and `d` objects. - Wired the same object ranges through Select mode and `d`/`c`/`y` operator rails, so delete/change/yank compose instead of duplicating per-verb logic. - Added delimiter/quote matching for `m m`, `m s`, `m a`, and explicit pair selectors such as `m (` / `m {` / quotes, with escaped quote handling. - Added text fallbacks for indent blocks, parameter ranges, enclosing forms, and diagnostic-line selection. - Added adversarial unmatched-delimiter behavior that reports visibly without corrupting the buffer. Verification: - `zig fmt src/session.zig src/tui.zig && zig build test` - `zig build` - `zig build v1-smoke` - `zig build run -- --help` - `zig build run -- src/main.zig` - `redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` Notes: - This closes the composable object/selection/delimiter slice. Rich syntax/LSP-backed object precision can improve later, but #47 now has working textual fallbacks and shared verb-object behavior.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tmk241/mim#47