提交 374c4e3e 编写于 作者: A Alex Dima

Fixes #9675: Do not push undo stops when compositing

上级 ac973ed4
......@@ -1426,8 +1426,7 @@ export class Cursor extends EventEmitter {
private _replacePreviousChar(ctx: IMultipleCursorOperationContext): boolean {
let text = ctx.eventData.text;
let replaceCharCnt = ctx.eventData.replaceCharCnt;
return this._invokeForAll(ctx,(cursorIndex, oneCursor, oneCtx) => OneCursorOp.replacePreviousChar(oneCursor, text, replaceCharCnt, oneCtx));
return this._invokeForAll(ctx,(cursorIndex, oneCursor, oneCtx) => OneCursorOp.replacePreviousChar(oneCursor, text, replaceCharCnt, oneCtx), false, false);
}
private _tab(ctx: IMultipleCursorOperationContext): boolean {
......
......@@ -2060,6 +2060,35 @@ suite('Editor Controller - Regression tests', () => {
assertCursor(cursor, new Position(3, 2));
});
});
test('issue #9675: Undo/Redo adds a stop in between CHN Characters', () => {
usingCursor({
text: [
]
}, (model, cursor) => {
assertCursor(cursor, new Position(1, 1));
// Typing sennsei in Japanese - Hiragana
cursorCommand(cursor, H.Type, { text: ''}, 'keyboard');
cursorCommand(cursor, H.ReplacePreviousChar, {text: '', replaceCharCnt: 1});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せn', replaceCharCnt: 1});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せん', replaceCharCnt: 2});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せんs', replaceCharCnt: 2});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せんせ', replaceCharCnt: 3});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せんせ', replaceCharCnt: 3});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せんせい', replaceCharCnt: 3});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せんせい', replaceCharCnt: 4});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せんせい', replaceCharCnt: 4});
cursorCommand(cursor, H.ReplacePreviousChar, {text: 'せんせい', replaceCharCnt: 4});
assert.equal(model.getLineContent(1), 'せんせい');
assertCursor(cursor, new Position(1, 5));
cursorCommand(cursor, H.Undo);
assert.equal(model.getLineContent(1), '');
assertCursor(cursor, new Position(1, 1));
});
});
});
suite('Editor Controller - Cursor Configuration', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册