MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / focusCellAtOffset

Method focusCellAtOffset

packages/app-core/src/lib/cm-table.ts:880–885  ·  view source on GitHub ↗

Focus a cell, landing the block cursor at a source offset (or its last * char). Used when h/l cross a cell boundary and by j/k.

(row: number, col: number, offset: number | 'end')

Source from the content-addressed store, hash-verified

878 /** Focus a cell, landing the block cursor at a source offset (or its last
879 * char). Used when h/l cross a cell boundary and by j/k. */
880 private focusCellAtOffset(row: number, col: number, offset: number | 'end'): void {
881 const cell = this.cellEl(row, col)
882 if (!cell) return
883 this.pendingOffset = offset
884 cell.focus()
885 }
886
887 /** Put a focused cell into NORMAL mode: non-editable, raw source shown, with
888 * the block cursor drawn over the current character. */

Callers 4

moveCharRightMethod · 0.95
moveCharLeftMethod · 0.95
moveRowDownMethod · 0.95
moveRowUpMethod · 0.95

Calls 1

cellElMethod · 0.95

Tested by

no test coverage detected