F4 — cycle $ (relative ⇄ absolute) on the reference under the caret, as a PURE text rewrite.
Tokenizes value (a formula string — =/+/- lead), reads the caret cell token's refSide
(self / left / right — the range corner, provided by the SDK), cycles that corner on a
throwaway formula (no commit), and returns the rewritten text plus the caret position at the END of
the cell that was toggled (so the caret stays roughly in place rather than jumping mid-reference,
and a repeat F4 stays on the same range). null when the caret isn't on a reference cell, the text
isn't a formula, or the rewrite fails — the caller leaves the edit untouched.
Shared by the cell editor's caret handle (SheetCellInput) and the reference field
(useFormulaInput's reference grammar, which runs it per comma-segment) so F4 behaves identically in both.
F4 — cycle
$(relative ⇄ absolute) on the reference under the caret, as a PURE text rewrite. Tokenizesvalue(a formula string —=/+/-lead), reads the caret cell token'srefSide(self/left/right— the range corner, provided by the SDK), cycles that corner on a throwaway formula (no commit), and returns the rewritten text plus the caret position at the END of the cell that was toggled (so the caret stays roughly in place rather than jumping mid-reference, and a repeat F4 stays on the same range).nullwhen the caret isn't on a reference cell, the text isn't a formula, or the rewrite fails — the caller leaves the edit untouched.Shared by the cell editor's caret handle (
SheetCellInput) and the reference field (useFormulaInput's reference grammar, which runs it per comma-segment) so F4 behaves identically in both.