File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ declare global {
133133// -------
134134//
135135// True to enable additional debug logging.
136- export const DEBUG_ENABLED = false ;
136+ export const DEBUG_ENABLED = true ;
137137
138138// The ID of the autosave timer; when this timer expires, the document will be
139139// autosaved.
@@ -219,7 +219,9 @@ const on_dom_content_loaded = (on_load_func: () => void) => {
219219//
220220// True if this is a CodeChat Editor document (not a source file).
221221const is_doc_only = ( ) => {
222- return current_metadata [ "mode" ] === "markdown" ;
222+ // This might be called by the framework before a document is loaded.
223+ // So, make sure `current_metadata` exists first.
224+ return current_metadata !== undefined && current_metadata [ "mode" ] === "markdown" ;
223225} ;
224226
225227// Wait for the DOM to load before opening the file.
You can’t perform that action at this time.
0 commit comments