File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ WCCode.WCCode = class extends WCCodeMirror {
6262 this . loadingBar . setText ( 'coding environment loading complete' )
6363 this . loadingBar . setDone ( )
6464 this . elements . run . removeAttribute ( 'disabled' )
65+ this . resetEditorTheme ( )
6566 }
6667
6768 checkLanguageExists ( ) {
@@ -150,7 +151,7 @@ WCCode.WCCode = class extends WCCodeMirror {
150151 const base = 'https://codemirror.net/theme/'
151152 const url = base + theme + '.css'
152153 Utils . addCSSLinkIfRequired ( url , import . meta. url )
153- }
154+ }
154155 }
155156
156157
@@ -249,6 +250,14 @@ WCCode.WCCode = class extends WCCodeMirror {
249250 a . download = filename
250251 a . click ( )
251252 }
253+
254+ /*
255+ * Idk why this is required, but is sometimes the theming
256+ * breaks without this
257+ */
258+ resetEditorTheme ( ) {
259+ this . editor . setOption ( "mode" , this . getAttribute ( "mode" ) )
260+ }
252261}
253262
254263window . WCCode = WCCode
You can’t perform that action at this time.
0 commit comments