Fix duplicated character when composing text (#234)

This commit is contained in:
mooonfly
2025-07-11 02:37:29 +08:00
committed by GitHub
parent 333b64e7f3
commit 2b07d1a493

View File

@@ -6,6 +6,9 @@ export function singleLineExtensions(): Extension {
(tr: Transaction): TransactionSpec | TransactionSpec[] => {
if (!tr.isUserEvent('input')) return tr;
// when composing text via IME, return
if (tr.isUserEvent('input.type.compose')) return tr;
const specs: TransactionSpec[] = [];
tr.changes.iterChanges((_, toA, fromB, toB, inserted) => {
let insert = '';