mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
fix(app): insert a newline on Enter inside code blocks (#2674)
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user