(chunks: RMarkdownChunk[] = _getChunks(),
line: number = _getStartLine())
| 244 | } |
| 245 | |
| 246 | export async function runPreviousChunk(chunks: RMarkdownChunk[] = _getChunks(), |
| 247 | line: number = _getStartLine()): Promise<void> { |
| 248 | const currentChunk = getCurrentChunk(chunks, line); |
| 249 | const previousChunk = getPreviousChunk(chunks, line); |
| 250 | |
| 251 | // Case: cursor is below the last chunk, run last chunk |
| 252 | if (currentChunk && line > currentChunk.endLine) { |
| 253 | await(runChunksInTerm([currentChunk.codeRange])); |
| 254 | // Case: currentChunk is not the first chunk, so run previousChunk |
| 255 | } else if (previousChunk && previousChunk !== currentChunk) { |
| 256 | await runChunksInTerm([previousChunk.codeRange]); |
| 257 | } |
| 258 | |
| 259 | } |
| 260 | |
| 261 | export async function runNextChunk(chunks: RMarkdownChunk[] = _getChunks(), |
| 262 | line: number = _getStartLine()): Promise<void> { |
nothing calls this directly
no test coverage detected