This commit is contained in:
Timothy Jaeryang Baek 2025-05-28 02:10:54 +04:00
parent d81886e315
commit bf7a18a0f8

View File

@ -301,6 +301,12 @@
}
if (event.key === 'Enter') {
if (event.shiftKey) {
editor.commands.setHardBreak(); // Insert a hard break
view.dispatch(view.state.tr.scrollIntoView()); // Move viewport to the cursor
event.preventDefault();
return true;
} else {
// Check if the current selection is inside a structured block (like codeBlock or list)
const { state } = view;
const { $head } = state.selection;
@ -327,6 +333,7 @@
return false;
}
}
}
// Handle shift + Enter for a line break
if (shiftEnter) {