File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ export async function createVerilogCircuit() {
4747 )
4848
4949 if ( returned ) {
50+ if ( ! editor ) {
51+ setupCodeMirrorEnvironment ( )
52+ }
53+
5054 verilogModeSet ( true )
5155
5256 try {
@@ -102,7 +106,9 @@ function clearVerilogOutput() {
102106}
103107
104108export function resetVerilogCode ( ) {
105- editor . setValue ( globalScope . verilogMetadata . code )
109+ if ( editor ) {
110+ editor . setValue ( globalScope . verilogMetadata . code )
111+ }
106112}
107113
108114export function hasVerilogCodeChanges ( ) {
@@ -311,6 +317,7 @@ export default function generateVerilogCircuit(
311317
312318export function setupCodeMirrorEnvironment ( ) {
313319 var myTextarea = document . getElementById ( 'codeTextArea' )
320+ if ( ! myTextarea ) return
314321
315322 CodeMirror . commands . autocomplete = function ( cm ) {
316323 cm . showHint ( { hint : CodeMirror . hint . anyword } )
You can’t perform that action at this time.
0 commit comments