mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 12:55:19 +00:00
refac
This commit is contained in:
parent
d81886e315
commit
bf7a18a0f8
1 changed files with 26 additions and 19 deletions
|
|
@ -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…
Reference in a new issue