mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-16 17:45:59 +08:00
refac
This commit is contained in:
parent
d81886e315
commit
bf7a18a0f8
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user