fix(app): insert a newline on Enter inside code blocks (#2674)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-11 13:20:26 +02:00
1 parent 2830221949
commit a5af857564
9 files changed
+1052 -50

No files matched your search

@@ -4,7 +4,7 @@ import type {ComposerTypeaheadActiveState} from '@app/features/lexical/composer/
import {analyzeCodeIndent} from '@app/features/lexical/composer/codeBlockIndent';
import {
$captureSelectionOffsets,
$getComposerDisplayText,
$getComposerScanText,
$replaceComposerRange,
$selectComposerRange,
} from '@app/features/lexical/composer/composerOffsets';
@@ -27,7 +27,7 @@ export function registerComposerCodeIndent(
const backward = offsets.anchor > offsets.focus;
const start = Math.min(offsets.anchor, offsets.focus);
const end = Math.max(offsets.anchor, offsets.focus);
const plan = analyzeCodeIndent($getComposerDisplayText(), start, end, event != null && event.shiftKey === true);
const plan = analyzeCodeIndent($getComposerScanText(), start, end, event != null && event.shiftKey === true);
if (plan == null) {
return false;
}