mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Fix -e for first line of scene
This commit is contained in:
parent
33ffd4863a
commit
602fbd1a9f
1 changed files with 3 additions and 1 deletions
|
@ -230,6 +230,8 @@ def insert_embed_line(file_name: str, scene_name: str, line_marker: str):
|
||||||
if len(line.strip()) > 0 and get_indent(line) < n_spaces:
|
if len(line.strip()) > 0 and get_indent(line) < n_spaces:
|
||||||
prev_line_num = index - 2
|
prev_line_num = index - 2
|
||||||
break
|
break
|
||||||
|
if prev_line_num is None:
|
||||||
|
prev_line_num = len(lines) - 2
|
||||||
elif line_marker.isdigit():
|
elif line_marker.isdigit():
|
||||||
# Treat the argument as a line number
|
# Treat the argument as a line number
|
||||||
prev_line_num = int(line_marker) - 1
|
prev_line_num = int(line_marker) - 1
|
||||||
|
@ -238,7 +240,7 @@ def insert_embed_line(file_name: str, scene_name: str, line_marker: str):
|
||||||
try:
|
try:
|
||||||
prev_line_num = next(
|
prev_line_num = next(
|
||||||
i
|
i
|
||||||
for i in range(len(lines) - 1, scene_line_number, -1)
|
for i in range(scene_line_number, len(lines) - 1)
|
||||||
if line_marker in lines[i]
|
if line_marker in lines[i]
|
||||||
)
|
)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
|
|
Loading…
Add table
Reference in a new issue