Skip to content

Commit 4cc004d

Browse files
committed
Playground: Handle statements on same line
1 parent 2a8b99b commit 4cc004d

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

docs/src/py/notebook.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,16 @@ def execute(cmd, no_except=True, inline=False, init='', g=None):
484484

485485
# Format source as Python console statements
486486
start = node.lineno
487+
col_start = node.col_offset
487488
end = node.end_lineno
489+
col_end = node.end_col_offset
488490
stmt = lines[start - 1: end]
489491
command = ''
490492
for i, line in enumerate(stmt, 0):
491493
if i == 0:
492-
stmt[i] = '>>> ' + line
494+
stmt[i] = '>>> ' + line[col_start:col_end]
493495
else:
494-
stmt[i] = '... ' + line
496+
stmt[i] = '... ' + line[col_start:col_end]
495497
command += '\n'.join(stmt)
496498
if isinstance(node, AST_BLOCKS):
497499
command += '\n... '

docs/theme/assets/coloraide-extras/extra-notebook-UmZ-G8NV.js renamed to docs/theme/assets/coloraide-extras/extra-notebook-C-gQPRdO.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/theme/assets/coloraide-extras/extra-notebook-UmZ-G8NV.js.map renamed to docs/theme/assets/coloraide-extras/extra-notebook-C-gQPRdO.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ extra_javascript:
311311
- https://unpkg.com/mermaid@10.6.1/dist/mermaid.min.js
312312
- playground-config-4f0f586c.js
313313
- https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js
314-
- assets/coloraide-extras/extra-notebook-UmZ-G8NV.js
314+
- assets/coloraide-extras/extra-notebook-C-gQPRdO.js
315315

316316
extra:
317317
social:

0 commit comments

Comments
 (0)