Skip to content

Commit 08f40b0

Browse files
committed
Merge remote-tracking branch 'origin/LG-5129/ce-undo-redo' into LG-5464/ce-cleanup
2 parents e5c9712 + 981bdc5 commit 08f40b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/code-editor/src/CodeEditor/CodeEditor.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,30 +166,30 @@ export const CodeEditor = forwardRef<CodeEditorHandle, CodeEditorProps>(
166166
* @returns boolean indicating if undo was successful
167167
*/
168168
const handleUndo = useCallback((): boolean => {
169-
const commands = modules?.['@codemirror/commands'];
169+
const commands = coreModules?.['@codemirror/commands'];
170170

171171
if (!editorViewRef.current || !commands) {
172172
console.warn('Undo is not available - editor or commands not loaded');
173173
return false;
174174
}
175175

176176
return commands.undo(editorViewRef.current);
177-
}, [modules]);
177+
}, [coreModules]);
178178

179179
/**
180180
* Redoes the last undone editor action if possible.
181181
* @returns boolean indicating if redo was successful
182182
*/
183183
const handleRedo = useCallback((): boolean => {
184-
const commands = modules?.['@codemirror/commands'];
184+
const commands = coreModules?.['@codemirror/commands'];
185185

186186
if (!editorViewRef.current || !commands) {
187187
console.warn('Redo is not available - editor or commands not loaded');
188188
return false;
189189
}
190190

191191
return commands.redo(editorViewRef.current);
192-
}, [modules]);
192+
}, [coreModules]);
193193

194194
useLayoutEffect(() => {
195195
const EditorView = coreModules?.['@codemirror/view'];

0 commit comments

Comments
 (0)