From e861fde7cd048778a31c8ae632fb84471cb2883f Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 23 Nov 2026 15:37:17 +0100 Subject: [PATCH] fix: Enter does nothing in the chat input after selecting all text (#34760) After selecting everything in the chat input with Ctrl+A or Cmd+A, pressing Enter did nothing. The message was not sent, and the browser console showed a RangeError. Enter now sends the message as usual, and Shift+Enter no longer logs that error. Fixes #34758 --- src/lib/components/common/RichTextInput.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/common/RichTextInput.svelte b/src/lib/components/common/RichTextInput.svelte index 9a5a46d526..3aadaed70f 100644 --- a/src/lib/components/common/RichTextInput.svelte +++ b/src/lib/components/common/RichTextInput.svelte @@ -1339,8 +1339,8 @@ const { state } = view; const { $from } = state.selection; - const lineStart = $from.before($from.depth); - const lineEnd = $from.after($from.depth); + const lineStart = $from.start(); + const lineEnd = $from.end(); const lineText = state.doc.textBetween(lineStart, lineEnd, '\n', '\0').trim(); if (event.shiftKey && !isCtrlPressed) { if (lineText.startsWith('```')) {