|
@@ -37,6 +37,8 @@
|
|
codeEditor.dispatch({
|
|
codeEditor.dispatch({
|
|
changes: [{ from: 0, to: codeEditor.state.doc.length, insert: formattedCode }]
|
|
changes: [{ from: 0, to: codeEditor.state.doc.length, insert: formattedCode }]
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ toast.success('Code formatted successfully');
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -59,13 +61,15 @@
|
|
];
|
|
];
|
|
|
|
|
|
onMount(() => {
|
|
onMount(() => {
|
|
|
|
+ value = boilerplate;
|
|
|
|
+
|
|
// Check if html class has dark mode
|
|
// Check if html class has dark mode
|
|
isDarkMode = document.documentElement.classList.contains('dark');
|
|
isDarkMode = document.documentElement.classList.contains('dark');
|
|
|
|
|
|
// python code editor, highlight python code
|
|
// python code editor, highlight python code
|
|
codeEditor = new EditorView({
|
|
codeEditor = new EditorView({
|
|
state: EditorState.create({
|
|
state: EditorState.create({
|
|
- doc: boilerplate,
|
|
|
|
|
|
+ doc: value,
|
|
extensions: extensions
|
|
extensions: extensions
|
|
}),
|
|
}),
|
|
parent: document.getElementById('code-textarea')
|
|
parent: document.getElementById('code-textarea')
|