Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init autoreload feature #99

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"ansi",
"Ansi",
"autoplay",
"autoreload",
"cmds",
"github",
"ipython",
Expand All @@ -55,6 +56,7 @@
"MANIM",
"manimgl",
"Sanderson's",
"venv",
"youtube"
]
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@
"configuration": {
"title": "Manim Notebook",
"properties": {
"manim-notebook.autoreload": {
"type": "boolean",
"default": "true",
"markdownDescription": "If enabled, Manim will be startup with the `--autoreload` flag, such that your imported Python modules are reloaded automatically in the background."
},
"manim-notebook.clipboardTimeout": {
"type": "number",
"default": 650,
Expand Down
6 changes: 5 additions & 1 deletion src/startStopScene.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as vscode from 'vscode';
import { ManimShell, NoActiveShellError } from './manimShell';
import { window } from 'vscode';
import { window, workspace } from 'vscode';
import { Logger, Window } from './logger';
import { findClassLines, findManimSceneName } from './pythonParsing';

Expand Down Expand Up @@ -65,6 +65,10 @@ export async function startScene(lineStart?: number) {
shouldPreviewWholeScene = false;
cmds.push(`-se ${lineNumber + 1}`);
}
const autoreload = await workspace.getConfiguration("manim-notebook").get("autoreload");
if (autoreload) {
cmds.push("--autoreload");
}
const command = cmds.join(" ");

// Run the command
Expand Down