Simplify paste handling (#16654)

This commit is contained in:
Tommaso Sciortino
2026-01-14 13:27:36 -08:00
committed by GitHub
parent 41369f67eb
commit 94d5ae541e
22 changed files with 25 additions and 97 deletions

View File

@@ -2223,10 +2223,10 @@ export function useTextBuffer({
(key: Key): void => {
const { sequence: input } = key;
if (key.paste) {
if (key.name === 'paste') {
// Do not do any other processing on pastes so ensure we handle them
// before all other cases.
insert(input, { paste: key.paste });
insert(input, { paste: true });
return;
}
@@ -2253,7 +2253,7 @@ export function useTextBuffer({
else if (keyMatchers[Command.UNDO](key)) undo();
else if (keyMatchers[Command.REDO](key)) redo();
else if (key.insertable) {
insert(input, { paste: key.paste });
insert(input, { paste: false });
}
},
[