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
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-23 18:37:17 +04:00
1 parent b7ce1bd194
commit e861fde7cd
1 file changed
+2 -2
@@ -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('```')) {