|
|
@@ -10,7 +10,7 @@ import { GlobalCodeMirrorEditorKey, AcceptedUploadFileType } from '../../consts'
|
|
|
import { useFileDropzone, FileDropzoneOverlay } from '../../services';
|
|
|
import {
|
|
|
getLineToCursor, adjustPasteData,
|
|
|
- useNewlineAndIndentContinueMarkdownList,
|
|
|
+ // useNewlineAndIndentContinueMarkdownList,
|
|
|
} from '../../services/list-util/markdown-list-util';
|
|
|
import { useCodeMirrorEditorIsolated } from '../../stores';
|
|
|
|
|
|
@@ -55,25 +55,25 @@ export const CodeMirrorEditor = (props: Props): JSX.Element => {
|
|
|
|
|
|
const editor = codeMirrorEditor?.view;
|
|
|
|
|
|
- const newlineAndIndentContinueMarkdownList = useNewlineAndIndentContinueMarkdownList(editor);
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- const handleEnterKey = (event: KeyboardEvent) => {
|
|
|
- if (event.key === 'Enter') {
|
|
|
- event.preventDefault();
|
|
|
- if (editor == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- newlineAndIndentContinueMarkdownList?.(editor);
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- editor?.dom.addEventListener('keydown', handleEnterKey);
|
|
|
-
|
|
|
- return () => {
|
|
|
- editor?.dom.removeEventListener('keydown', handleEnterKey);
|
|
|
- };
|
|
|
- }, [codeMirrorEditor, editor, newlineAndIndentContinueMarkdownList]);
|
|
|
+ // const newlineAndIndentContinueMarkdownList = useNewlineAndIndentContinueMarkdownList(editor);
|
|
|
+
|
|
|
+ // useEffect(() => {
|
|
|
+ // const handleEnterKey = (event: KeyboardEvent) => {
|
|
|
+ // if (event.key === 'Enter') {
|
|
|
+ // event.preventDefault();
|
|
|
+ // if (editor == null) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // newlineAndIndentContinueMarkdownList?.(editor);
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+
|
|
|
+ // editor?.dom.addEventListener('keydown', handleEnterKey);
|
|
|
+
|
|
|
+ // return () => {
|
|
|
+ // editor?.dom.removeEventListener('keydown', handleEnterKey);
|
|
|
+ // };
|
|
|
+ // }, [codeMirrorEditor, editor, newlineAndIndentContinueMarkdownList]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (indentSize == null) {
|