Skip to content

Commit 56fcba9

Browse files
committed
Fixes microsoft#87614: Ignore composition that doesn't do anything
1 parent a732c7f commit 56fcba9

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/vs/editor/common/controller/cursorTypeOperations.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,15 @@ export class TypeOperations {
269269
commands[i] = null;
270270
continue;
271271
}
272-
let pos = selection.getPosition();
273-
let startColumn = Math.max(1, pos.column - replaceCharCnt);
274-
let range = new Range(pos.lineNumber, startColumn, pos.lineNumber, pos.column);
272+
const pos = selection.getPosition();
273+
const startColumn = Math.max(1, pos.column - replaceCharCnt);
274+
const range = new Range(pos.lineNumber, startColumn, pos.lineNumber, pos.column);
275+
const oldText = model.getValueInRange(range);
276+
if (oldText === txt) {
277+
// => ignore composition that doesn't do anything
278+
commands[i] = null;
279+
continue;
280+
}
275281
commands[i] = new ReplaceCommand(range, txt);
276282
}
277283
return new EditOperationResult(EditOperationType.Typing, commands, {

0 commit comments

Comments
 (0)