feat(ui): vim-style count buffer #89

Merged
barrettruth merged 1 commit from feat/count-buffer into main 2026-03-25 15:58:21 +00:00
barrettruth commented 2026-03-25 15:57:56 +00:00

Problem

Motions and operators only worked on single tasks — no 5j, 3dd, 2bb, or 5G.

Solution

Add countBuf ref that accumulates digit keypresses (1-9, plus 0 if digits already buffered — matching vim's 0 behavior). Count is consumed on the next non-digit key and multiplies the action:

  • [n]j / [n]k — move cursor by n
  • [n]dd / [n]pp / [n]ww / [n]bb — apply operator to n tasks from cursor
  • [n]x — complete n tasks from cursor
  • [n]G — go to line n (no count = last line)
  • [n]gg — go to line n (no count = first line)

pendingG and pendingOp refs now carry the count through their two-key sequences. Visual mode operators still apply to selection regardless of count. Closes #73.

## Problem Motions and operators only worked on single tasks — no `5j`, `3dd`, `2bb`, or `5G`. ## Solution Add `countBuf` ref that accumulates digit keypresses (1-9, plus 0 if digits already buffered — matching vim's `0` behavior). Count is consumed on the next non-digit key and multiplies the action: - `[n]j` / `[n]k` — move cursor by n - `[n]dd` / `[n]pp` / `[n]ww` / `[n]bb` — apply operator to n tasks from cursor - `[n]x` — complete n tasks from cursor - `[n]G` — go to line n (no count = last line) - `[n]gg` — go to line n (no count = first line) `pendingG` and `pendingOp` refs now carry the count through their two-key sequences. Visual mode operators still apply to selection regardless of count. Closes #73.
Sign in to join this conversation.
No description provided.