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({
161
161
if ( settings . get_boolean ( "auto-preview" ) ) schedule_update ( ) ;
162
162
} ) ;
163
163
let symbols = null ;
164
- async function update ( force = false ) {
164
+ async function update ( force = false , clearConsole = true ) {
165
165
if ( ! ( force || settings . get_boolean ( "auto-preview" ) ) ) return ;
166
166
let text = panel_ui . xml . trim ( ) ;
167
167
let target_id ;
@@ -203,7 +203,9 @@ export default function Previewer({
203
203
204
204
registerSignals ( { tree, scope, symbols, template } ) ;
205
205
206
- term_console . clear ( ) ;
206
+ if ( clearConsole ) {
207
+ term_console . clear ( ) ;
208
+ }
207
209
208
210
try {
209
211
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 }) {
329
329
330
330
previewer . start ( ) ;
331
331
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 ) ;
332
335
333
336
button_run . set_sensitive ( true ) ;
334
337
term_console . scrollToEnd ( ) ;
@@ -345,8 +348,6 @@ export default function Window({ application, session }) {
345
348
}
346
349
347
350
if ( language === "JavaScript" ) {
348
- await previewer . update ( true ) ;
349
-
350
351
// We have to create a new file each time
351
352
// because gjs doesn't appear to use etag for module caching
352
353
// ?foo=Date.now() also does not work as expected
You can’t perform that action at this time.
0 commit comments