DEV: removes code block enter edge case (#31773)

This was causing some confusion and now that we have the chat preference
to send with enter or metakey+enter it's even more confusing.

If your setting is send on enter, you need to use shift+enter for a new
line, even in codeblocks. If your setting is meta+enter you need to use
enter in the codeblock for a new line, meta+enter will send as expected.
This commit is contained in:
Joffrey JAFFEUX
2025-03-12 18:01:00 +01:00
committed by GitHub
parent 38ba191be0
commit 1f2043de4e

View File

@ -359,12 +359,6 @@ export default class ChatComposer extends Component {
}
if (event.key === "Enter") {
// if we are inside a code block just insert newline
const { pre } = this.composer.textarea.getSelected({ lineVal: true });
if (this.composer.textarea.isInside(pre, /(^|\n)```/g)) {
return;
}
const shortcutPreference =
this.currentUser.user_option.chat_send_shortcut;
const send =