|
@@ -14,7 +14,7 @@ export const getLineToCursor = (editor: EditorView, lineNumBeforeCursor = 0): st
|
|
|
const curPos = editor.state.selection.main.head;
|
|
const curPos = editor.state.selection.main.head;
|
|
|
const firstLineNumToGet = editor.state.doc.lineAt(curPos).number - lineNumBeforeCursor;
|
|
const firstLineNumToGet = editor.state.doc.lineAt(curPos).number - lineNumBeforeCursor;
|
|
|
|
|
|
|
|
- const fixedFirstLineNumToGet = Math.max(firstLineNumToGet, 0);
|
|
|
|
|
|
|
+ const fixedFirstLineNumToGet = Math.max(firstLineNumToGet, 1);
|
|
|
|
|
|
|
|
const firstLineToGet = editor.state.doc.line(fixedFirstLineNumToGet).from;
|
|
const firstLineToGet = editor.state.doc.line(fixedFirstLineNumToGet).from;
|
|
|
|
|
|
|
@@ -37,6 +37,9 @@ export const useNewlineAndIndentContinueMarkdownList = (editor?: EditorView): Ne
|
|
|
const indentAndMark = matchResult[0];
|
|
const indentAndMark = matchResult[0];
|
|
|
insertText(indentAndMark, lineStartPos, curPos);
|
|
insertText(indentAndMark, lineStartPos, curPos);
|
|
|
}
|
|
}
|
|
|
|
|
+ else {
|
|
|
|
|
+ insertText('', lineStartPos, curPos);
|
|
|
|
|
+ }
|
|
|
}, [insertText]);
|
|
}, [insertText]);
|
|
|
|
|
|
|
|
if (editor == null) {
|
|
if (editor == null) {
|