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

Function captureNoteJumpLocation

packages/app-core/src/store.ts:1135–1149  ·  view source on GitHub ↗
(state: {
  selectedPath: string | null
  editorViewRef: EditorView | null
})

Source from the content-addressed store, hash-verified

1133}
1134
1135function captureNoteJumpLocation(state: {
1136 selectedPath: string | null
1137 editorViewRef: EditorView | null
1138}): NoteJumpLocation | null {
1139 if (!isJumpHistoryTabPath(state.selectedPath)) return null
1140 const selection = state.editorViewRef?.state.selection.main
1141 return {
1142 path: state.selectedPath,
1143 editorSelectionAnchor: selection?.anchor ?? 0,
1144 editorSelectionHead: selection?.head ?? 0,
1145 editorScrollTop: state.editorViewRef?.scrollDOM.scrollTop ?? 0,
1146 previewScrollTop: getVisiblePreviewScrollElement()?.scrollTop ?? 0,
1147 editorScrollMode: 'preserve'
1148 }
1149}
1150
1151function resolveTaskLineNumber(body: string, task: VaultTask): number {
1152 const lines = body.split('\n')

Callers 2

selectNoteImplFunction · 0.85
jumpThroughNoteHistoryFunction · 0.85

Calls 2

isJumpHistoryTabPathFunction · 0.85

Tested by

no test coverage detected