Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/commons/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,7 @@ const EditorBase = React.memo((props: EditorProps & LocalStateProps) => {
// hopelessly incomplete
editor.on(
'gutterclick' as any,
makeHandleGutterClick(
(...args) => handleEditorUpdateBreakpointsRef.current(...args),
props.editorTabIndex
) as any
makeHandleGutterClick(handleEditorUpdateBreakpointsRef.current, props.editorTabIndex)
);

// Change all info annotations to error annotations
Expand Down Expand Up @@ -485,8 +482,16 @@ const EditorBase = React.memo((props: EditorProps & LocalStateProps) => {
if (!reactAceRef.current) {
return;
}
handleEditorValueChange(props.editorTabIndex, newCode);

shiftBreakpointsWithCode(reactAceRef.current.editor, delta);

// Write editor state for the active editor tab to the store.
handleEditorValueChange(props.editorTabIndex, newCode);
handleEditorUpdateBreakpointsRef.current(
Copy link
Member Author

@ianyong ianyong Sep 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea why this callback function is wrapped in a ref but I'm afraid that removing it will cause some other regression elsewhere.

props.editorTabIndex,
reactAceRef.current.editor.session.getBreakpoints()
);

if (handleUpdateHasUnsavedChanges) {
handleUpdateHasUnsavedChanges(true);
}
Expand Down