@@ -23,7 +23,7 @@ export function EditorPanel(props: { editorInterface: Ref<EditorInterface> }) {
2323 editor . IEditorDecorationsCollection | undefined
2424 > ( undefined )
2525 const monaco = useMonaco ( )
26- const { initialPC, setInitialPC, editorRef, error, simulation } =
26+ const { initialPC, setInitialPC, editorRef, error, simulation, setError } =
2727 useSimulationContext ( )
2828
2929 useImperativeHandle ( props . editorInterface , ( ) => ( {
@@ -38,7 +38,7 @@ export function EditorPanel(props: { editorInterface: Ref<EditorInterface> }) {
3838 else localStorage . setItem ( LOCAL_STORAGE_EDITOR_KEY , current . getValue ( ) )
3939 }
4040
41- addEventListener ( "beforeunload" , onBeforeUnload )
41+ addEventListener ( "beforeunload" , onBeforeUnload )
4242
4343 return ( ) => {
4444 window . removeEventListener ( "beforeunload" , onBeforeUnload )
@@ -70,7 +70,7 @@ export function EditorPanel(props: { editorInterface: Ref<EditorInterface> }) {
7070 options : {
7171 isWholeLine : true ,
7272 blockClassName : "errorVscode" ,
73- blockPadding : [ error . line , 0 , error . line , 55 ] ,
73+ blockPadding : [ 0 , 55 , 0 , 85 ] ,
7474 shouldFillLineOnLineBreak : true ,
7575 stickiness :
7676 monaco . editor . TrackedRangeStickiness . NeverGrowsWhenTypingAtEdges ,
@@ -81,8 +81,8 @@ export function EditorPanel(props: { editorInterface: Ref<EditorInterface> }) {
8181
8282 const handleChange = ( ) => {
8383 // When the user is editing his code, we should dismiss the error line \ toast.
84+ if ( error ) setError ( undefined )
8485 toasts . forEach ( ( t ) => toast . dismiss ( t . id ) )
85- decorations ?. clear ( )
8686 }
8787
8888 return (
0 commit comments