(state: {
selectedPath: string | null
editorViewRef: EditorView | null
})
| 1133 | } |
| 1134 | |
| 1135 | function 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 | |
| 1151 | function resolveTaskLineNumber(body: string, task: VaultTask): number { |
| 1152 | const lines = body.split('\n') |
no test coverage detected