Commit a concrete next-model: re-serialize and write it over the source. * The dispatch rebuilds the decorations (a fresh widget), so we refocus the * requested cell on the next frame. Used by the context menu, which has * already computed `next` from the current model.
(next: MarkdownTable, focus?: CellAddress)
| 167 | * requested cell on the next frame. Used by the context menu, which has |
| 168 | * already computed `next` from the current model. */ |
| 169 | private applyModel(next: MarkdownTable, focus?: CellAddress): void { |
| 170 | // Capture the live range BEFORE the dispatch detaches our DOM. |
| 171 | const dom = this.dom as HTMLElement |
| 172 | this.model = next |
| 173 | this.dirty = false |
| 174 | commitTable(this.view, dom, next) |
| 175 | if (focus) { |
| 176 | requestAnimationFrame(() => this.focusCellAt(focus)) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | /** Pull pending cell edits into the model, then apply a structural |
| 181 | * transform and commit — all without an intermediate dispatch, so our DOM |
no test coverage detected