@@ -335,6 +335,14 @@ const EditorBase = React.memo((props: EditorProps & LocalStateProps) => {
335335 handlePromptAutocompleteRef . current = props . handlePromptAutocomplete ;
336336 } , [ props . handleEditorUpdateBreakpoints , props . handlePromptAutocomplete ] ) ;
337337
338+ React . useEffect ( ( ) => {
339+ const editor = reactAceRef . current ?. editor ;
340+ if ( editor === undefined ) {
341+ return ;
342+ }
343+ displayBreakpoints ( editor , props . breakpoints ) ;
344+ } , [ props . breakpoints ] ) ;
345+
338346 // Handles input into AceEditor causing app to scroll to the top on iOS Safari
339347 React . useEffect ( ( ) => {
340348 const isIOS = / i P h o n e | i P a d | i P o d / . test ( navigator . userAgent ) ;
@@ -443,7 +451,7 @@ const EditorBase = React.memo((props: EditorProps & LocalStateProps) => {
443451 }
444452 }
445453
446- const { onChange, onLoad } = aceEditorProps ;
454+ const { onChange } = aceEditorProps ;
447455
448456 aceEditorProps . onChange = React . useCallback (
449457 ( newCode : string , delta : Ace . Delta ) => {
@@ -472,16 +480,6 @@ const EditorBase = React.memo((props: EditorProps & LocalStateProps) => {
472480 ]
473481 ) ;
474482
475- aceEditorProps . onLoad = React . useCallback (
476- ( editor : IAceEditor ) => {
477- displayBreakpoints ( editor , props . breakpoints ) ;
478- if ( onLoad !== undefined ) {
479- onLoad ( editor ) ;
480- }
481- } ,
482- [ props . breakpoints , onLoad ]
483- ) ;
484-
485483 aceEditorProps . commands = Object . entries ( keyHandlers )
486484 . filter ( ( [ _ , exec ] ) => exec )
487485 . map ( ( [ name , exec ] ) => ( { name, bindKey : keyBindings [ name ] , exec : exec ! } ) ) ;
0 commit comments