@@ -230,7 +230,7 @@ export default function Window({ application, session }) {
230230 let compiler_rust = null ;
231231 let builder_python = null ;
232232
233- async function runCode ( { format } ) {
233+ async function runCode ( ) {
234234 button_run . set_sensitive ( false ) ;
235235
236236 term_console . clear ( ) ;
@@ -240,9 +240,7 @@ export default function Window({ application, session }) {
240240 try {
241241 await panel_ui . update ( ) ;
242242
243- if ( format ) {
244- await formatCode ( ) ;
245- }
243+ await formatCode ( ) ;
246244
247245 await compile ( ) ;
248246 } catch ( err ) {
@@ -346,7 +344,7 @@ export default function Window({ application, session }) {
346344 name : "run" ,
347345 } ) ;
348346 action_run . connect ( "activate" , ( ) => {
349- runCode ( { format : true } ) . catch ( console . error ) ;
347+ runCode ( ) . catch ( console . error ) ;
350348 } ) ;
351349 window . add_action ( action_run ) ;
352350 application . set_accels_for_action ( "win.run" , [ "<Control>Return" ] ) ;
@@ -380,7 +378,7 @@ export default function Window({ application, session }) {
380378 window . present ( ) ;
381379
382380 const documents = Object . values ( langs ) . map ( ( lang ) => lang . document ) ;
383- async function load ( { run } ) {
381+ async function load ( ) {
384382 panel_ui . stop ( ) ;
385383 previewer . stop ( ) ;
386384 documents . forEach ( ( document ) => document . stop ( ) ) ;
@@ -397,15 +395,11 @@ export default function Window({ application, session }) {
397395
398396 await previewer . useInternal ( ) ;
399397
400- if ( run ) {
401- await runCode ( { format : false } ) ;
402- } else {
403- term_console . clear ( ) ;
404- panel_ui . start ( ) ;
405- await panel_ui . update ( ) ;
406- previewer . start ( ) ;
407- await previewer . update ( true ) ;
408- }
398+ term_console . clear ( ) ;
399+ panel_ui . start ( ) ;
400+ await panel_ui . update ( ) ;
401+ previewer . start ( ) ;
402+ await previewer . update ( true ) ;
409403
410404 documents . forEach ( ( document ) => {
411405 document . start ( ) ;
@@ -414,7 +408,7 @@ export default function Window({ application, session }) {
414408 term_console . scrollToEnd ( ) ;
415409 }
416410
417- return { load, window } ;
411+ return { load, window, runCode } ;
418412}
419413
420414async function setGtk4PreferDark ( dark ) {
0 commit comments