From b9c5795410b4f3f79fab9b21f1944ffe58a8d58a Mon Sep 17 00:00:00 2001 From: u-tung Date: Sat, 13 Dec 2025 10:13:05 +0800 Subject: [PATCH] fix: issue#9867 fix that in the case of multiple cursors, when composing input of two or more characters, only one cursor is correctly inputting related issue: #9867 --- src/textEditor.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/textEditor.ts b/src/textEditor.ts index 16063f507de..4748e5cd618 100644 --- a/src/textEditor.ts +++ b/src/textEditor.ts @@ -29,11 +29,10 @@ export class TextEditor { if (!letVSCodeHandleKeystrokes) { await editor.edit((editBuilder) => { - if (!at) { - at = editor.selection.active; + const positions = at === undefined ? editor.selections.map((s) => s.active) : [at]; + for (const pos of positions) { + editBuilder.insert(pos, text); } - - editBuilder.insert(at, text); }); } else { await vscode.commands.executeCommand('default:type', { text });