File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ export default function Previewer({
161161 if ( settings . get_boolean ( "auto-preview" ) ) schedule_update ( ) ;
162162 } ) ;
163163 let symbols = null ;
164- async function update ( force = false ) {
164+ async function update ( force = false , clearConsole = true ) {
165165 if ( ! ( force || settings . get_boolean ( "auto-preview" ) ) ) return ;
166166 let text = panel_ui . xml . trim ( ) ;
167167 let target_id ;
@@ -203,7 +203,9 @@ export default function Previewer({
203203
204204 registerSignals ( { tree, scope, symbols, template } ) ;
205205
206- term_console . clear ( ) ;
206+ if ( clearConsole ) {
207+ term_console . clear ( ) ;
208+ }
207209
208210 try {
209211 builder . add_from_string ( text , - 1 ) ;
Original file line number Diff line number Diff line change @@ -329,6 +329,9 @@ export default function Window({ application, session }) {
329329
330330 previewer . start ( ) ;
331331 panel_ui . start ( ) ;
332+ // We already cleared the console before starting.
333+ // We don't want to clear the console again, as this would hide compile errors if any occurred.
334+ await previewer . update ( true , false ) ;
332335
333336 button_run . set_sensitive ( true ) ;
334337 term_console . scrollToEnd ( ) ;
@@ -345,8 +348,6 @@ export default function Window({ application, session }) {
345348 }
346349
347350 if ( language === "JavaScript" ) {
348- await previewer . update ( true ) ;
349-
350351 // We have to create a new file each time
351352 // because gjs doesn't appear to use etag for module caching
352353 // ?foo=Date.now() also does not work as expected
You can’t perform that action at this time.
0 commit comments