Switch the focused cell into INSERT mode at a source offset: editable, * native caret, block cursor removed. Don't re-focus — that re-fires the * focus handler, snapping back to NORMAL.
(cell: HTMLElement, caretOffset: number)
| 985 | * native caret, block cursor removed. Don't re-focus — that re-fires the |
| 986 | * focus handler, snapping back to NORMAL. */ |
| 987 | private enterInsertMode(cell: HTMLElement, caretOffset: number): void { |
| 988 | this.cellMode = 'insert' |
| 989 | this.pendingOp = null |
| 990 | this.pendingScope = null |
| 991 | this.visualMode = false |
| 992 | this.visualScope = null |
| 993 | this.clearCellCursor(cell) |
| 994 | cell.classList.remove('is-vim-normal') |
| 995 | cell.setAttribute('contenteditable', 'true') |
| 996 | if (cell.dataset.rendered !== 'false') { |
| 997 | cell.textContent = cell.dataset.raw ?? '' |
| 998 | cell.dataset.rendered = 'false' |
| 999 | } |
| 1000 | placeCaretAt(cell, caretOffset) |
| 1001 | } |
| 1002 | |
| 1003 | /** Delete `[from, to)` from the focused cell's source in place (no dispatch — |
| 1004 | * committed on blur, like typing). Re-renders the NORMAL block cursor. */ |
no test coverage detected