From 77309a634b984bd0279a13fd7134c5d7c324b787 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sun, 29 May 2022 16:37:00 -0700 Subject: [PATCH] Fix to embed insertion --- manimlib/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manimlib/config.py b/manimlib/config.py index cf8fbed0..55a33d87 100644 --- a/manimlib/config.py +++ b/manimlib/config.py @@ -228,10 +228,10 @@ def insert_embed_line(file_name: str, scene_name: str, line_marker: str): n_spaces = get_indent(line) + 4 elif in_construct: if len(line.strip()) > 0 and get_indent(line) < n_spaces: - prev_line_num = index - 2 + prev_line_num = index - 1 break if prev_line_num is None: - prev_line_num = len(lines) - 2 + prev_line_num = len(lines) - 1 elif line_marker.isdigit(): # Treat the argument as a line number prev_line_num = int(line_marker) - 1