mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-23 01:02:57 +00:00
fix small issue
This commit is contained in:
@@ -355,14 +355,23 @@ const Editor = forwardRef(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const redo = ()=>codeEditor.current?.redo();
|
||||||
|
const historySize = ()=>codeEditor.current?.historySize();
|
||||||
|
const undo = ()=>codeEditor.current?.undo();
|
||||||
|
const foldCode = ()=>codeEditor.current?.foldAll();
|
||||||
|
const unfoldCode = ()=>codeEditor.current?.unfoldAll();
|
||||||
|
|
||||||
|
const update = ()=>{};
|
||||||
|
|
||||||
useImperativeHandle(ref, ()=>({
|
useImperativeHandle(ref, ()=>({
|
||||||
update : ()=>{},
|
update,
|
||||||
undo : ()=>codeEditor.current?.undo(),
|
undo,
|
||||||
redo : ()=>codeEditor.current?.redo(),
|
redo,
|
||||||
foldCode : ()=>codeEditor.current?.foldAll(),
|
foldCode,
|
||||||
unfoldCode : ()=>codeEditor.current?.unfoldAll(),
|
unfoldCode,
|
||||||
historySize : ()=>codeEditor.current?.historySize(),
|
historySize,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='editor' ref={editor}>
|
<div className='editor' ref={editor}>
|
||||||
<SnippetBar
|
<SnippetBar
|
||||||
|
|||||||
Reference in New Issue
Block a user