The active cell (bold border/handle, formula bar target) used to track
selection.focus, so it followed the mouse/cursor while dragging or
shift-extending a range. Switch it to selection.anchor -- the first cell of
the current selection action -- so it stays put while the range grows,
matching Excel/Numbers. Tab/Enter data-entry flow already keeps anchor ==
focus while it moves the cursor, so that behaviour is unaffected.
- document.ts: activeCell/activeCellName/activeCellInput read the anchor.
- FormulaBar.vue: commits to the anchor cell to match what it displays.
- TableGrid.vue: isActive() (border + handle) and F2/type-to-edit target
the anchor; Home/End keep using the cursor's row via s.focus.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- store: copySelection/cutSelection/pasteClipboard/cancelClipboard hold an
in-memory (unpersisted) clipboard buffer of raw cell inputs + formatting.
- shiftFormula rewrites every relative cell reference in a copied/cut formula
by the move delta (the engine has no $-absolute refs, so all refs qualify).
Copy shifts every reference uniformly; cut only follows references that
point inside the moved block itself, leaving refs to untouched cells alone
and never touching a qualified Table!A1 reference.
- paste anchors on a smaller/single-cell selection (and overflows past it),
or tiles across a selection that's an exact larger multiple of the buffer.
- TableGrid: Strg+C/X/V shortcuts, context-menu entries, a dashed "clip-src"
source marker, and Escape drops a pending buffer.
- document.spec.ts: coverage for reference shifting, tiled/fill paste, cut's
inside/outside reference split, format copy, and Escape cancelling.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>