refac
This commit is contained in:
1 parent
d81886e315
commit
bf7a18a0f8
1 file changed
+7
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user