Formula editing with reference highlighting
When a user edits a formula cell, the editor shows the raw formula, colours each reference, and outlines the matching cells in the same colours. Users can insert a reference by clicking a cell or by using the arrow keys while in point mode. This makes formulas understandable and quick to write.
Planned. This page shows the specification from issue #192. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid with an optional formula bar above it. Cell E2 contains =A2+C2*B2.
Expected behavior
Pressing F2 on E2 shows each reference in a different colour, with matching cell outlines. In point mode, typing '+' and then pressing ArrowLeft inserts the address of the adjacent cell. Escape cancels the edit and restores the previous formula.
Planned API surface
option: formulas.highlightReferencesoption: formulas.pointModeoption: formulas.formulaBarevent: formulaEditStartevent: formulaEditEndmethod: api.startEditingCellAcceptance criteria
- Each distinct reference gets a unique, colour-blind-safe colour along with a pattern or border-style difference. (pending)
- Clicking a cell during editing inserts its address at the caret position. (pending)
- Escape restores the previous formula. Enter commits and triggers recalculation. (pending)
- The formula bar and the in-cell editor stay in sync. (pending)